Page 1 of 1

using oufil files/fnames , outrec and include condition simultaneously in Sort..?

Posted: Sun Jun 13, 2021 5:56 pm
by AmjzadAli
Hi,

Is there anyone who uses oufil files/fnames , outrec and include condition simultaneously in Sort..? I am getting error.

Re: using oufil files/fnames , outrec and include condition simultaneously in Sort..?

Posted: Sun Jun 13, 2021 7:50 pm
by Anuj Dhawan
Well, without really knowing the specifics about your problem - below code works with all different key-words you've asked for:

Code: Select all

//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=1,  
INCLUDE=(2,2,CH,EQ,C'01',AND,40,4,CH,EQ,C'ABCD')
OUTREC FIELDS=(1:14,42)
May be you should know that irrespective of the order in which you code the statements, they are processed in an order by SORT - SORT statement, OUTREC statement, OUTFIL statements.

Hope this helps.