Copy a file using syncsort with different record length



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

Copy a file using syncsort with different record length

Postby macnano » Wed Feb 06, 2013 5:09 am

Can someone help me on how to copy a file (recfm=fb & lrecl=40) to a new file (recfm=fb & lrecl=35)with shorter record lenght using syncsort? Also, if I would like to copy a file (recfm=fb & lrecl=35)to a new file (recfm=fb & lrecl=40) with longer record length and the populate the last 5 positions with a constant value e.g. ABCDE.

Thanks.
macnano
 
Posts: 9
Joined: Wed Feb 06, 2013 3:07 am
Has thanked: 1 time
Been thanked: 0 time

Re: Copy a file using syncsort with different record length

 

Re: Copy a file using syncsort with different record length

Postby BillyBoyo » Wed Feb 06, 2013 6:12 am

There is a SyncSort part of the forum where this should have been posted.
  OPTION COPY
  INREC BUILD=(1,35)


  OPTION COPY
  INREC OVERLAY=(36:C'ABCDE')

or

  INREC BUILD=(1,35,C'ABCDE')


If it is the same file, you can do it in one shot:

  OPTION COPY
  INREC OVERLAY=(36:C'ABCDE')


And, yes, that is the same as the one to extend the length.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Copy a file using syncsort with different record length

Postby macnano » Fri Feb 08, 2013 4:24 am

Thanks for your quick response. This works for one output file. Now I have another question - if there are more than one output file and I have to splt the input file base on some criteria e.g. last 3 positions of the input file is AAA then the output will be SORTOF1, if it is BBB, then SORTOF2, and CCC then the output will be SORTOF3. The output files will not have the last 3 positions of the input file. i tried using INREC and INCLUDE statement but it did not work.
macnano
 
Posts: 9
Joined: Wed Feb 06, 2013 3:07 am
Has thanked: 1 time
Been thanked: 0 time

Re: Copy a file using syncsort with different record length

Postby BillyBoyo » Fri Feb 08, 2013 4:35 am

You need OUTFIL. OUTFIL has INCLUDE= or OMIT= to select records.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Copy a file using syncsort with different record length

Postby macnano » Fri Feb 08, 2013 4:53 am

I was about to retract my post since I got it without using INREC but allocate the output datasets with LRECL=1708 where the input file LRECL=1711.
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(1709,3,CH,EQ,C'AAA')
OUTFIL FILES=2,
INCLUDE=(1709,3,CH,EQ,C'BBB')
OUTFIL FILES=3,
INCLUDE=(1709,3,CH,EQ,C'CCC')

Thanks
macnano
 
Posts: 9
Joined: Wed Feb 06, 2013 3:07 am
Has thanked: 1 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post