Page 1 of 1

overlay

PostPosted: Thu Jul 19, 2012 1:10 pm
by jvinoth
Hi I have a sequential file fixed block and the length is 78

In the file the first record has the zzzzzzzzzzzzzzzYzzzzzzzzzzzzzzz value for all 78 character.
using outrect i am changing the all 16:c'Y' but not in the header record how to achive this using sort.
can we use overlay how to do using overlay.

Re: overlay

PostPosted: Thu Jul 19, 2012 1:16 pm
by BillyBoyo
Have you changed jobs so you now have DFSORT?

Can you show what sort cards you have, a sample of your input, and the expected output, with recfms and lrecls.

Re: overlay

PostPosted: Thu Jul 19, 2012 2:18 pm
by jvinoth
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1,15,CH,EQ,C'ZZZZZZZZZZZZZZZ'),
OVERLAY=(16:C'Z'),BUILD=(01:01,15,16:C'Y',17:17,62))


its my sort card but getting the error: WER270A OUTREC STATEMENT : DUPLICATE PARM FOUND
please tell me how to solve this.

Re: overlay

PostPosted: Thu Jul 19, 2012 2:34 pm
by BillyBoyo
You have Syncsort, so please don't post in the DFSORT forum. Your topic has been moved.

I don't have Syncsort, but you can't have OVERLAY and BUILD on the same IFTHEN. You don't need to.

You haven't shown any sample data, so can't tell much more yet.

Re: overlay

PostPosted: Thu Jul 19, 2012 2:39 pm
by jvinoth
Header records has zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
and the output record header has zzzzzzzzzzzzzzzzzzzzzYzzzzzzzzzzz Y-in the 16 th positon how to overlay that particulat position.

Re: overlay

PostPosted: Thu Jul 19, 2012 2:50 pm
by BillyBoyo
Just code the OVERLAY like you have, except with the value you want. No need for a BUILD. OVERLAY will take the current record, make the changes you specify, and leave the rest of the record undisturbed.

Re: overlay

PostPosted: Thu Jul 19, 2012 3:39 pm
by jvinoth
but i need to change the other records as Y in the 16th field..

Re: overlay

PostPosted: Thu Jul 19, 2012 3:47 pm
by BillyBoyo
If all records need Y or some other same value you can make the OVERLAY unconditional.

If, for the data records, you need to do other things, you can make that conditional and do a second OVERLAY, putting the first as IFTHEN=(WHEN=INIT.

Re: overlay

PostPosted: Thu Jul 19, 2012 4:32 pm
by jvinoth
how to do that billy can you please tell me..position need to overlay in ouput is 16.
record length:78,FB, output also has the same length.

Re: overlay

PostPosted: Thu Jul 19, 2012 4:58 pm
by BillyBoyo
  OPTION COPY
  INREC OVERLAY=(16:C'Y')


  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(16:C'Y')),
        IFTHEN=(WHEN=(condition),OVERLAY=(someothercolumnsanddata))


Something like one of those. Hit your manual, try some things out. Let us know.