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

I want to combine two files with following logic


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

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Mon May 19, 2008 7:02 pm
Reply with quote

I have two input files...

File1:
AAA
BBB
CCC
DDD
...
...
...

File2:
111
222
333
444
555

In File-1 so many Records & in File-2 only 5 records...

Now I want 1 output file (File-3) in following way

File3:
AAA 111
AAA 222
AAA 333
AAA 444
AAA 555
BBB 111
BBB 222
BBB 333
BBB 444
BBB 555
---
---
---
---

Please provide me solution for these if anyone has faced this situation
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon May 19, 2008 9:38 pm
Reply with quote

Gaurav Bhayawala,


The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=your file2 with 5 records,
//            DISP=SHR                                       
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)   
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  OUTREC BUILD=(C'VALUE',SEQNUM,2,ZD,C',C''',1,3,C'''',80:X)
/*
//STEP0200 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SYMNAMES DD DSN=&&T1,DISP=SHR                             
//SORTIN   DD DSN=your large input file,
//            DISP=SHR
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  OUTFIL BUILD=(1,3,X,VALUE01,/,                             
                1,3,X,VALUE02,/,                             
                1,3,X,VALUE03,/,                             
                1,3,X,VALUE04,/,                             
                1,3,X,VALUE05)                               
/*


Hope this helps...

Cheers
Back to top
View user's profile Send private message
Gaurav Bhayawala

New User


Joined: 17 Apr 2008
Posts: 14
Location: Pune

PostPosted: Tue May 20, 2008 11:55 am
Reply with quote

Thanks Skolusu
This approach is working..
Back to top
View user's profile Send private message
zawx

New User


Joined: 28 Feb 2008
Posts: 21
Location: china

PostPosted: Thu Mar 19, 2009 6:44 am
Reply with quote

If every one input file have one million records,
the 'OUTFIL BUILD' in stp0200 write
OUTFIL BUILD=(1,3,X,VALUE01,/,
1,3,X,VALUE02,/,
1,3,X,VALUE03,/,
1,3,X,VALUE04,/,
1,3,X,VALUE05,/,
...
1,3,x,VALUE1000000)

Is it right?
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top