Page 1 of 1

INREC FIELDS & OVERLAY together.

PostPosted: Mon Dec 15, 2008 5:51 pm
by ranga_subham
Hi,

Would you please tell me how to use INREC FIELDS (or BUILD) and OVERLAY together.

Thanks.

Re: INREC FIELDS & OVERLAY together.

PostPosted: Mon Dec 15, 2008 9:20 pm
by Alissa Margulies
Do you have actual data that you are working with and encountering a problem, or is this just a general question?

Re: INREC FIELDS & OVERLAY together.

PostPosted: Tue Dec 16, 2008 1:37 am
by ranga_subham
I was just experimenting with the INREC and came out with this doubt.......

I was trying to use below code and it failed as it would in any case.......

OPTION COPY
INREC FIELDS=(3,3,12,3),OVERLAY=(3:C'Z',12:C'0')


I tried below and it went fine.....

OPTION COPY
INREC OVERLAY=(3:C'Z',,12:C'0')
OUTREC FIELDS=(3,3,12,3)


Thanks.

Re: INREC FIELDS & OVERLAY together.

PostPosted: Tue Dec 16, 2008 1:48 am
by Alissa Margulies
If this is SORTIN:
111111111111111
222222222222222
333333333333333

Then this JCL:
//SYSIN DD *
   SORT FIELDS=COPY
   INREC BUILD=(3,2,C'Z',12,3,12:C'0')

would produce the following output:
11Z111     0
22Z222     0
33Z333     0

If this is not the desired output, then please post sample output records.

Please note, the only time you would need both BUILD and OVERLAY in an INREC statement is with the use of IFTHEN.