Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
I want to combine two files with following logic

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: I want to combine two files with following logic
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    Post subject: Reply to: I want to combine two files with following logic
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    Post subject: Reply to: I want to combine two files with following logic
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us