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

SYNCSORT - Append fields from one file to another file


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

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Wed Dec 09, 2009 8:00 pm
Reply with quote

The sort product in use is SYNCSORT

We have 2 files File1 and File2.
LRECL of file1 is 8 and its FB file.
LRECL of file2 is 18 and its FB file.

File1 contains only one record with date (i.e.20091208).
File2 contains 'n' records of 18 bytes.

The date from file1 needs to be appended to all records of file2 at end.

Example:
File 1:
20091208
File2:
11111111111111111A
22222222222222222B
33333333333333333C
44444444444444444A

Expected output file:
11111111111111111A20091208
22222222222222222B20091208
33333333333333333C20091208
44444444444444444A20091208
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Dec 10, 2009 3:26 am
Reply with quote

Hi Abi,

this may help
Code:
//S1       EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *      INPUT FILE1                                       
20091208                                                               
/*                                                                     
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)         
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  INREC BUILD=(C'VALUE1,''',1,8,C'''',80:X)                             
/*                                                                     
//S2       EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                                 
//SORTIN   DD *     INPUT FILE2                                         
11111111111111111A                                                     
22222222222222222B                                                     
33333333333333333C                                                     
44444444444444444A                                                     
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                   
  OPTION COPY                     
  OUTREC BUILD=(1,18,VALUE1)       
/*                                 



Gerry
Back to top
View user's profile Send private message
mssabirami

New User


Joined: 11 Feb 2008
Posts: 17
Location: Chennai

PostPosted: Thu Dec 10, 2009 10:58 am
Reply with quote

Thanks Gerry...Its working fine.. icon_biggrin.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top