Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Syntax for merging two different files
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 18
Location: Hyderabad

PostPosted: Thu Jul 24, 2008 12:58 pm    Post subject:
Reply with quote

Alissa,

Alissa Margulies wrote:
... Or, do you simply want to pair Record1 from File1 to Record1 of File2, and Record2 from File1 with Record2 of File2, etc...


Yes. I just want to pair record1 from file1 to record2 of file2, etc....
Back to top
View user's profile Send private message
References
PostPosted: Thu Jul 24, 2008 12:58 pm    Post subject: Re: Reply with quote

Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 18
Location: Hyderabad

PostPosted: Thu Jul 24, 2008 1:01 pm    Post subject:
Reply with quote

Alissa,

Quote:
... Or, do you simply want to pair Record1 from File1 to Record1 of File2, and Record2 from File1 with Record2 of File2, etc...


Yes. I want to pair Record1 from File1 to Recor1 of File2, etc....
Back to top
View user's profile Send private message
arcvns

Senior Member


Joined: 17 Oct 2006
Posts: 391
Location: Chennai, India

PostPosted: Thu Jul 24, 2008 1:51 pm    Post subject:
Reply with quote

Bharat,

Are both the files having equal number of records. If not, what is your expected output in that case?

Thanks,
Arun
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 200
Location: USA

PostPosted: Thu Jul 24, 2008 8:07 pm    Post subject:
Reply with quote

Bharath,

This SyncSort job should produce the desired results:
Code:
//STEP1 EXEC PGM=SORT                     
//SORTIN  DD *                             
FIELD1                                     
FIELD2                                     
FIELD3                                     
//SORTOUT DD DSN=&&TEMP1,DISP=(NEW,PASS)
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                               
   SORT FIELDS=COPY                       
   OUTREC FIELDS=(1:SEQNUM,4,ZD,1,6)       
//*****************************************
//STEP2 EXEC PGM=SORT                     
//SORTIN  DD *                             
FIELD4                                     
FIELD5                                     
FIELD6                                     
//SORTOUT DD DSN=&&TEMP2,DISP=(NEW,PASS)
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                               
   SORT FIELDS=COPY                       
   OUTREC FIELDS=(1:SEQNUM,4,ZD,1,6)       
//*****************************************
//STEP3  EXEC PGM=SORT                     
//SORTJNF1 DD DSN=&&TEMP1,DISP=(OLD,DELETE)
//SORTJNF2 DD DSN=&&TEMP2,DISP=(OLD,DELETE)
//SORTOUT  DD DSN=FINAL.OUTPUT
//SYSOUT   DD SYSOUT=*                       
//SYSIN    DD *                               
   JOINKEYS FILES=F1,FIELDS=(1,4,A)       
   JOINKEYS FILES=F2,FIELDS=(1,4,A)       
   REFORMAT FIELDS=(F1:5,6,F2:5,6)         
   SORT FIELDS=COPY                       
   OUTREC FIELDS=(1,6,1X,7,6)             
/* 
Back to top
View user's profile Send private message
Bharath Nadipally

New User


Joined: 24 Jun 2008
Posts: 18
Location: Hyderabad

PostPosted: Sun Jul 27, 2008 7:33 pm    Post subject:
Reply with quote

Alissa,

Thank you very much.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2