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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am


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