Page 1 of 1

Easytrieve pgm to copy string from previous record

PostPosted: Wed Jul 30, 2014 5:09 pm
by srinivasa gunja
Hi everyone,

Can someone help me in writing a easytrieve pgm for copying the string to current record from previous records in the same position(if that position is null/spaces)
Or we can do it by sort utility
Input(seq no. (1,1)):

1 add1
1
2 add2
3 add3
4 add4
4


Output should look like this

1 add1
1 add1
2 add2
3 add3
4 add4
4 add4

Thanks in advance!

Srinivas

Re: Easytrieve pgm to copy string from previous record

PostPosted: Wed Jul 30, 2014 5:15 pm
by BillyBoyo
In Easytrieve Plus you define a "working storage" field, save the value from the first record, and use that value to populate the field in the required record once it has been read.

You can do the equivalent with SORT by using IFTHEN=WHEN=GROUP and PUSHing the value to a temporary extension to the record. When you have the second record, populate the field from the temporary extension, and return the record to its original size.

Re: Easytrieve pgm to copy string from previous record

PostPosted: Wed Jul 30, 2014 5:42 pm
by srinivasa gunja
Thanks BillyBoyo...

If possible can you please elobarate.