compare & move datas in file 1 to file 2 using syncsort?



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

compare & move datas in file 1 to file 2 using syncsort?

Postby maandi » Mon Dec 20, 2010 7:47 pm

Hi,

Using sync sort is it possible to move certain fields from one file to another file after comparing.

Scenario:

File 1:
E12345678902009
A23345677782010
d57676868792011

sync sort parameter file:
2010 (varies as per previous calculations)


My expected output file should be: A23345677782010


It should compare the field "year" (i.e 2010) in input file to the year "2010" in the parm file and retrieve the entire record of 2010...

Please let me know if its possible using Sync sort?

Thanks,
Maandy.
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: compare & move datas in file 1 to file 2 using syncsort?

 

Re: compare & move datas in file 1 to file 2 using syncsort?

Postby Alissa Margulies » Tue Dec 21, 2010 12:34 am

Hello Maandy.

Here is a SyncSort for z/OS job that will do what you asked:
//STEP1 EXEC PGM=SORT             
//SORTJNF1 DD *                   
E12345678902009                   
A23345677782010                   
D57676868792011                   
//SORTJNF2 DD *                   
2010                               
//SORTOUT DD SYSOUT=*             
//SYSOUT  DD SYSOUT=*               
//SYSIN   DD *                       
  JOINKEYS FILES=F1,FIELDS=(12,4,A)
  JOINKEYS FILES=F2,FIELDS=(1,4,A)
  REFORMAT FIELDS=(F1:1,80)       
  SORT FIELDS=COPY                 
/*                                 


Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: compare & move datas in file 1 to file 2 using syncsort?

Postby maandi » Tue Dec 21, 2010 1:02 pm

Hi Alissa,

It worked out well ... thanks a lot...
Could you explain how this JOINKEYS work...?


Thanks,
Maandy
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: compare & move datas in file 1 to file 2 using syncsort?

Postby Alissa Margulies » Tue Dec 21, 2010 9:38 pm

The JOINKEYS control statement is used to enable join feature processing and to identify the fields used to select records for join processing. The join feature joins records from two input files that are specified on the SORTJNF1 and SORTJNF2 DD statements. For complete details regarding SyncSort's join processing, please refer to the SyncSort for z/OS 1.3 Programmer's Guide.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post