IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

OVERLAY reccords in SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
a027412

New User


Joined: 05 Jul 2007
Posts: 40
Location: Minneapolis, MN

PostPosted: Tue Jun 02, 2009 9:05 pm
Reply with quote

Is this possible in SYNC sort?
File - 1
Code:

         000100
         000200
         000300
         000400
         000500
         000600
         000700
         000800
         000900
         001000


File - 2
Code:

0A01


Required Output
Code:

0A01     000100
0A01     000200
0A01     000300
0A01     000400
0A01     000500
0A01     000600
0A01     000700
0A01     000800
0A01     000900
0A01     001000


--> Input Files are in the same format and same LRECL
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Jun 02, 2009 9:56 pm
Reply with quote

Based on your sample data, you could use the following SyncSort for z/OS JOIN application to acquire your desired output:

Code:
//STEP1  EXEC PGM=SORT
//SORTJNF1 DD *       
         000100       
         000200       
         000300       
         000400       
         000500       
         000600       
         000700       
         000800       
         000900       
         001000       
//SORTJNF2 DD *       
0A01                 
//SORTOUT  DD SYSOUT=*
//SYSOUT   DD SYSOUT=* 
//SYSIN    DD *                                   
  JOINKEYS FILES=F1,FIELDS=(5,1,A),SORTED       
  JOINKEYS FILES=F2,FIELDS=(5,1,A),SORTED       
  REFORMAT FIELDS=(F2:1,4,F1:5,11)             
  SORT FIELDS=COPY                             
/*                                             


However, if your real data does not have a blank in position 5 for both files, and the data is not in sorted order, then this will need to be modified accordingly.

Alternately, you could use the following job:
Code:
//STEP1 EXEC PGM=SORT
//SORTIN  DD *                                                   
0A01                                                             
//        DD *                                                   
         000100                                                 
         000200                                                 
         000300                                                 
         000400                                                 
         000500                                                 
         000600                                                 
         000700                                                 
         000800                                                 
         000900                                                 
         001000                                                 
//SORTOUT DD SYSOUT=*                                           
//SYSOUT  DD SYSOUT=*                                           
//SYSIN   DD *                                                   
 SORT FIELDS=COPY                                               
 OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,NE,C' '),PUSH=(1:1,4)) 
 OUTFIL INCLUDE=(10,6,CH,NE,C' ')                               
/*                                                               

Please note that this 2nd solution requires SyncSort for z/OS 1.3.2.

Hope this helps.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top