Page 1 of 1

FileAid Batch - COPY-function

PostPosted: Thu Jul 14, 2011 7:49 pm
by LotharLochkarte
Hi,

I have the following code:
$$DD01     COPY IF=(5,EQ,C'SEG1'),
                MOVE=(01,10,17),     
                OUT=10               

How can I tell FileAid-Batch to print every record matching that IF-condition twice?

Best regards!

Re: FileAid Batch - COPY-function

PostPosted: Thu Jul 14, 2011 8:08 pm
by Ed Goodman
Do they need to be contiguous? If not, just list the file twice in the next step.

I don't think File-Aid CAN write twice. If any function can do it, it will be the USER function.

If you have sort available, you could use:

 SORT FIELDS=COPY
 INCLUDE COND=(5,4,CH,EQ,C'SEG1')
 OUTFIL OUTREC=(17,10,/,17,10)


That's if I remember my File-Aid format.

If it's a variable length file, you need to add 4 to all the positions, plus tell sort to make it fixed length:
 SORT FIELDS=COPY
 INCLUDE COND=(9,4,CH,EQ,C'SEG1')
 OUTFIL CONVERT,OUTREC=(21,10,/,21,10)

Re: FileAid Batch - COPY-function

PostPosted: Fri Jul 15, 2011 1:03 pm
by LotharLochkarte
The USER function was a very good idea! I just have to specify WRITE=DD01O twice and the selected record will be printed twice! :-)

Nice!

Re: FileAid Batch - COPY-function

PostPosted: Mon Jul 18, 2011 12:33 am
by Ed Goodman
That's awesome. We just lost File-Aid here, so I couldn't test it.

Re: FileAid Batch - COPY-function

PostPosted: Mon Jul 18, 2011 12:19 pm
by LotharLochkarte
I can't imagine working without FileAid... ;-)