I am already doing this with data structures in a slightly different way.
It will not work for me to capture the INPUT fields because I need a solution that is easy to replicate withou having to recreate the data structures and input output logic each time. The program logic does not allow for your solution because there are over a dozen record formats and different processing logic for each, so I would have to rewrite huge chunks of code. (Where you say 'write format' would essentially be duplicating the entire program logic).
I need to capture the OUTPUT, that is the 132 character string that is being sent to the printer, so that I could then simply loop through the saved lines and write them out.
Main Topics
Browse All Topics





by: daveslaterPosted on 2009-06-24 at 00:43:10ID: 24698983
Hi
you could use a Multi Occurance Data structure
the basic code is.
D ExtDs ds
D fld1 10
D fld2 10
D**......
D fldx 10
D MODS ds Occurs(12) Likeds(ExrDs)
/Free
Idx = 0 ;
Dow '1' = '1' ;
read Myfile ;
if %eof ;
leave ;
endif ;
fld1 = FileField1 ;
fld2 = FileField2 ;
fldx = FileField3 ;
idx+=1 ;
%occur(Mods) = Idx;
Mods = ExtDs ;
enddo ;
for idx1 = 1 to Idx ;
%occur(Mods) = Idx1;
// move MOds to print file
write format ;
endFor/
<<--------------------->>
Dave