Copy records for matching key appearing at different places.



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

Copy records for matching key appearing at different places.

Postby ranga_subham » Mon Feb 02, 2009 10:57 pm

Hi,

I want to compare FILE-1 & FILE-2 and compare matching records from FILE-2 to output file.

FILE-1: RECFM=FB, LRECL=80
TBIG100
TBIG200
TBIG980


FILE-2: RECFM=FB, LRECL=88

XMART_C%F#N_TBIG800_FINTE%AM
PRIN%CE%TON_FINTEAM_BAR%^*&SA_TBIG200
OVERLAY*&_COMPO%$%ITT_TBIG100
XMART_CAPT#*_09900_TBIG910
JUMPR%&_TBIG980_RSECUR@@_FIN


Expected Output:

OVERLAY*&_COMPO%$%ITT_TBIG100
PRIN%CE%TON_FINTEAM_BAR%^*&SA_TBIG200
JUMPR%&_TBIG980_RSECUR@@_FIN


Please let me know how to do it.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Copy records for matching key appearing at different places.

Postby Alissa Margulies » Tue Feb 03, 2009 10:59 pm

Here is one way of accomplishing this task:
//S1     EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
XMART_C%F#N_TBIG800_FINTE%AM                                       
PRIN%CE%TON_FINTEAM_BAR%^*&SA_TBIG200                             
OVERLAY*&_COMPO%$%ITT_TBIG100                                     
XMART_CAPT#*_09900_TBIG910                                         
JUMPR%&_TBIG980_RSECUR@@_FIN                                       
//SORTOUT  DD DSN=&TEMP,DISP=(NEW,CATLG),...
//SYSIN    DD *                                                   
   SORT FIELDS=COPY
   OUTREC PARSE=(%1=(ENDBEFR=C'TBIG',FIXLEN=40),                   
         %2=(ENDBEFR=BLANKS,FIXLEN=40)),                           
         BUILD=(1:%1,41:C'TBIG',%2) 
//***********************************************************     
//S2     EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTOUT  DD SYSOUT=*                                             
//SORTJNF1 DD DSN=&TEMP,DISP=SHR       
//SORTJNF2 DD *                       
TBIG100                               
TBIG200                               
TBIG980                               
//SYSIN    DD *                       
   JOINKEYS FILE=F1,FIELDS=(41,7,A)   
   JOINKEYS FILE=F2,FIELDS=(1,7,A)     
   REFORMAT FIELDS=(F1:1,80)           
   SORT FIELDS=COPY                   
   OUTREC BUILD=(1,80,SQZ=(SHIFT=LEFT))                               

You may need to modify the field positions to reflect your actual data.

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: 3 times

Re: Copy records for matching key appearing at different places.

Postby ranga_subham » Tue Feb 03, 2009 11:01 pm

Hi, Thanks for your immediate help. It would not help me much as our site not going for SYNCSORT upgrade at least until 2010 :(

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post