Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

OVERLAY reccords in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: OVERLAY reccords in SORT
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: 500
Location: USA

PostPosted: Tue Jun 02, 2009 9:56 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us