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

How to Merge 2 files with the 2nd file having constant value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
erhema

New User


Joined: 07 Oct 2008
Posts: 23
Location: Chennai

PostPosted: Wed Mar 04, 2009 6:24 am
Reply with quote

Hello,

My first file will have n number of row eg: 5 rows (16 Record length)

1123ABCDEF081228
2342JKLSDFF090127
2342JKLSDFL090126
2342DFGFDY090125
2342JKLSDFP090124

My second file will always have 1 row with a 4 byte 'YYMM' value (15 Record length)

0903

I want my output file with all the rows of the first file concatenated with the same 4 byte value of 2nd file for each and every row in the First file (Output requires 5 rows)

1123ABCDEF0812280903
2342JKLSDFF0901270903
2342JKLSDFL0901260903
2342AFJOFDY0901250903
2342JKLSDFP0901240903

Please help me with the UTILITY, to satisfy this condition.

Thanks in advance.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 04, 2009 7:45 am
Reply with quote

Hi,

you can try this
Code:
//STEP010  EXEC PGM=SORT                                               
//SYSPRINT DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
0903                                                                   
/*                                                                     
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)       
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY                                                         
* CREATE DFSORT SYMBOL AS:                                             
* YYMM,'0903'                                                         
  OUTFIL FNAMES=SORTOUT,                                               
  BUILD=(C'YYMM,''',1,4,C'''',80:X)                                   
/*                                                                     
//STEP020  EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SYMNAMES DD DSN=&&S1,DISP=SHR                                       
///SORTIN   DD *                       
1123ABCDEF081228                       
2342JKLSDFF090127                     
2342JKLSDFL090126                     
2342DFGFDY090125                       
2342JKLSDFP090124                     
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                       
  SORT FIELDS=COPY                     
  OUTREC BUILD=(1,16,YYMM)             
/*                                                                         



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

New User


Joined: 07 Oct 2008
Posts: 23
Location: Chennai

PostPosted: Sat Mar 07, 2009 9:35 pm
Reply with quote

Hello Gerry,

It worked perfectly, Thanks for your help. I moved the code to production today.

regards
Hema
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top