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

How to insert a record between 2 records


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

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Apr 15, 2010 9:05 pm
Reply with quote

Since the values are sequential sort will do the job, but if the value is not 00002B1234 say 223411B1234 instead of 00002B1234 how to utilize the sort utility, in such case it fails my requirement.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 15, 2010 9:13 pm
Reply with quote

pkmurali wrote:
Since the values are sequential sort will do the job, but if the value is not 00002B1234 say 223411B1234 instead of 00002B1234 how to utilize the sort utility, in such case it fails my requirement.
So you are saying that option 2 is not what you want?
Quote:
You must choose one or the other.
1) The first record in file-1 inserted between the first and second record in file-2.
2) The record with the value 00002B1234 in file-1 inserted between the two records with the values 00001A1234 & 00003D1234 in file-2.

How about The first record in file-1 inserted between the two records with the values 00001A1234 & 00003D1234 in file-2?
Or how about option 1?
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Apr 15, 2010 9:23 pm
Reply with quote

I need option2 with this value 223411B1234 from file-1 to be inserted in file-2 between 00001A1234 & 00003D1234.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 15, 2010 9:34 pm
Reply with quote

pkmurali wrote:
I need option2 with this value 223411B1234 from file-1 to be inserted in file-2 between 00001A1234 & 00003D1234.
As asked before, does file-1 contain only the one record, whatever the value?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Apr 15, 2010 9:57 pm
Reply with quote

Based on the information provided so far, try this SyncSort for z/OS job and let us know whether or not it provides the desired output:
Code:
//STEP1 EXEC PGM=SORT                                           
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=FILE1,DISP=SHR                                                 
//SORTOUT DD DSN=&&TEMP1,DISP=(NEW,PASS)
//SYSIN   DD *                                                 
   INCLUDE COND=(1,11,CH,EQ,C'223411B1234')                     
   SORT FIELDS=COPY                                             
/*                                                                         
//STEP2 EXEC PGM=SORT                                           
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=&&TEMP1,DISP=(OLD,PASS)                         
//        DD DSN=FILE2,DISP=SHR                                                 
//SORTOUT DD SYSOUT=*                                           
//SYSIN   DD *                                       
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
         IFTHEN=(WHEN=(1,11,CH,EQ,C'223411B1234'),   
         OVERLAY=(81:C'00000003'))                         
   SORT FIELDS=(81,8,CH,A),EQUALS                   
   OUTREC BUILD=(1,80)                               
/*   
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top