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 SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
No new posts Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 12
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
Search our Forums:

Back to Top