Page 2 of 2

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 2:03 pm
by BillyBoyo
Firstly, change OUTFIL OUTREC to OUTFIL BUILD. It isn't your problem, but it will reduce confusion.

I think your problem is that you aren't creating 80-byte records, which is what SYNCTool will be expecting for a USING file.

 //CTL1CNTL DD *                                               
   OUTFIL FNAMES=CTL2CNTL,                                     
   OUTREC=(C' OUTREC BUILD=(1,96,',C'97:C''',25,10,C''')',80:X)


So put a blank in column 80. SORT will pad any intermediate unused bytes with blanks.

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 4:27 pm
by hariharan_bk
It worked.
Thanks !!

OUTFIL FNAMES=CTLDCNTL,
OUTREC=(C' INREC BUILD=(1,74,18X,75,22,',C'115:C''',25,10,C''')',80:X)

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 4:54 pm
by BillyBoyo
Bear in mind what I said about the OUTREC.

Consider this:

  INREC FIELDS=(1,10)
  OUTREC FIELDS=(1,10)
  OUTFIL OUTREC=(1,10)


And compare to this:

  INREC BUILD=(1,10)
  OUTREC BUILD=(1,10)
  OUTFIL BUILD=(1,10)


BUILD was introduced for clarity.

FIELDS= is "overloaded" (means different things in different contexts, see SORT, MERGE, SUM, JOINKEYS, REFORMAT, for instance).

OUTREC is overloaded. OUTREC is a control statement, and also a parameter of OUTFIL.

BUILD is only BUILD.

BUILD is an "alias" of FIELDS on INREC and OUTREC and OUTREC on OUTFIL. Function is identical, and SORT does not mind at all whether you use FIELDS on INREC and OUTREC and OUTREC on OUTFIL, but for the human reader, it is much clearer to use BUILD for any new code.

Existing code can be changed, but ensure that you have the OK to do that in your specification. It is entirely unproblematic to make the change (because it is just an alias) but if you accidentally break something else at the time, you won't be popular.

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 5:14 pm
by hariharan_bk
okay. Do you want me to make any changes? since I have already changed to INREC BUILD in the card.

INREC BUILD=(1,74,18X,75,22,',C'115:C''',25,10,C''')',80:X)

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 5:27 pm
by BillyBoyo
Yes, my further suggestion was prompted by the OUTFIL OUTREC=. That should be OUTFIL BUILD=.

Re: To append one field from file1 to all recs in another fi

PostPosted: Mon Aug 10, 2015 5:54 pm
by hariharan_bk
oh yes. Have them changed. Thanks

Will make sure to use Build wherever possible.