Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

File generation

Former Member
0 Likes
328

Hi,

i have a requirement to generate a file with some data and at end the last line of the file should contain

Character 1: &

Character 2-15: 14 spaces.

Character 16-20: Total count of detail records, right justified and prefixed with zero. That means count from line 3 to file till end.

Character 21-23: 3 spaces

Character 24-33: Total dollar value of detail records. Right justified and zero prefixed. That means total amount from line 3 of our file till end.

should display like -

& 00050 0058476995

What should be the logic that i need to apply here.If any code snippet, plz share the same.

Pls help me.

Thanks.

1 REPLY 1
Read only

Former Member
0 Likes
289

Hi,

You need to write CONCATENATE with RESPECTING BLANKS addition to capture the blanks.

Use offset to fill the string after that append the string to file.

Example:

data: v_text type string.

move '&' to v_text+0(1).

move ' ' to v_text+1(14). --> give 14 spaces

.

.

append v_text to file.

Regards,

Kumar Bandanadham

Edited by: Velangini Showry Maria Kumar Bandanadham on Jun 22, 2009 9:04 AM