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
 

 

SYNCSORT - Append fields from one file to another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT - Append fields from one file to another file
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: 1703
Location: Australia

PostPosted: Thu Dec 10, 2009 3:26 am    Post subject:
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    Post subject: Reply to: SYNCSORT - Append fields from one file to another
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    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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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