To append one field from file1 to all recs in another file



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

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

Postby BillyBoyo » Mon Aug 10, 2015 2:03 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby hariharan_bk » Mon Aug 10, 2015 4:27 pm

It worked.
Thanks !!

OUTFIL FNAMES=CTLDCNTL,
OUTREC=(C' INREC BUILD=(1,74,18X,75,22,',C'115:C''',25,10,C''')',80:X)
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

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

Postby BillyBoyo » Mon Aug 10, 2015 4:54 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby hariharan_bk » Mon Aug 10, 2015 5:14 pm

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)
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

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

Postby BillyBoyo » Mon Aug 10, 2015 5:27 pm

Yes, my further suggestion was prompted by the OUTFIL OUTREC=. That should be OUTFIL BUILD=.

These users thanked the author BillyBoyo for the post:
hariharan_bk (Fri Sep 23, 2016 8:53 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby hariharan_bk » Mon Aug 10, 2015 5:54 pm

oh yes. Have them changed. Thanks

Will make sure to use Build wherever possible.
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Previous

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post