join files with no matching keys



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

join files with no matching keys

Postby Tina_campbell » Tue Apr 27, 2010 11:11 pm

I have 2 Input Files with no matching keys .

FileA (FB format)
Customer_id (max 4 characters)
A001
A002
A003
A004

FileB(FB Format) - It has only one row always
Gift_amount - always 4 digits only
1000

Output
Customer_id Gift_Amount
A001 | 1000
A002 | 1000
A003 | 1000
A004 | 1000

Can someone please help me achieve this join using syncsort ?
Tina_campbell
 
Posts: 4
Joined: Tue Apr 27, 2010 10:38 pm
Has thanked: 0 time
Been thanked: 0 time

Re: join files with no matching keys

 

Re: join files with no matching keys

Postby Alissa Margulies » Tue Apr 27, 2010 11:59 pm

Here is a SyncSort for z/OS job that will do what you asked:
//S1    EXEC PGM=SORT 
//SYSOUT  DD SYSOUT=*   
//SORTIN  DD DISP=SHR,DSN=FILE.B 
//SORTOUT DD DSN=SYMBOLS.DATA,DISP=(NEW,PASS),
//           UNIT=SYSDA,SPACE=(TRK,1) 
//SYSIN   DD *   
  SORT FIELDS=COPY   
  OUTREC FIELDS=(C'APPEND,C',C'''',1,4,C'''',80:X) 
/*
//S2     EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DISP=SHR,DSN=FILE.A                                                         
//SORTOUT  DD SYSOUT=*   
//SYMNOUT  DD SYSOUT=* 
//SYMNAMES DD DSN=SYMBOLS.DATA,DISP=SHR   
//SYSIN    DD *   
  SORT FIELDS=COPY 
  OUTREC BUILD=(1,4,C' | ',APPEND)
/*
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: join files with no matching keys

Postby mainframe_novice » Wed Apr 28, 2010 12:47 am

Thank you very much .
You help is appreciated :D
It's working as expected .
mainframe_novice
 
Posts: 35
Joined: Tue Apr 27, 2010 1:29 am
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post