Application Development 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: 

Download data to Fixed Length Text File

Former Member
0 Kudos

Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Try as below when transferring records to file in application server:


TRANSFER <structure> TO <file> LENGTH <len>. 

Kind Regards

Eswar

3 REPLIES 3

Former Member
0 Kudos

Hi

Try as below when transferring records to file in application server:


TRANSFER <structure> TO <file> LENGTH <len>. 

Kind Regards

Eswar

0 Kudos

Example of data in the text file

123 ABC 8.00

1st field take up 8 character, so 123 oni take up 3 spaces, therefore it should have 5 spaces before the ABC.

Please advice.

0 Kudos

One way i would advice is to declare a text variable and move values using offset.


Eg:
  move: <struc>-fld1 to l_text(8),
        <struc>-fld2 to l_text+8(3),
        <struc>-fld3 to l_text+11(15).
  transfer l_text to <file>.

Try this approch and see the result.

Kind Regards

Eswar