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

Combining datasets into one


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

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Apr 29, 2009 4:44 pm
Reply with quote

Skolusu wrote:
ojdiaz,

Do you just want to match the records just by the order they came in each file? record 1 from file 1 should be tagged with record 1 in file 2 and record 2 from file 1 should be tagged with record 2 in file 2 and so on?

What is the LRECL/RECFM of the input files and desired output file?

Answer these questions and we will show you a way to do it



skolusu,
I've been held up with a same kind of issue. In my case, i have to merge four files (coloumns) into 1 like this all files are LRECL = 12 and FB. Please show me the way.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 29, 2009 8:40 pm
Reply with quote

Hello,

You need to post some sample input data and the output you want when that data is processed.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Apr 29, 2009 10:39 pm
Reply with quote

Itanium,

You can very easily combine all the 4 files together using the new when=group function. Since you did not provide me with any details , I assumed that there is no indicator in the files to identify from which file the record came from.

So inorder to identify the records, we concatenate a 1 line HDR record before each file and use the GROUP function to tag the records and append a sequence number to them.


Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
HDR                                                                 
//         DD *                                                     
FILE1-REC-01                                                         
FILE1-REC-02                                                         
//         DD *                                                     
HDR                                                                 
//         DD *                                                     
FILE2-REC-01                                                         
FILE2-REC-02                                                         
//         DD *                                                     
HDR                                                                 
//         DD *                                                     
FILE3-REC-01                                                         
FILE3-REC-02                                                         
//         DD *                                                     
HDR                                                                 
//         DD *                                                     
FILE4-REC-01                                                         
FILE4-REC-02                                                         
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  INREC IFTHEN=(WHEN=INIT,BUILD=(49:1,12)),                         
  IFTHEN=(WHEN=GROUP,BEGIN=(49,3,CH,EQ,C'HDR'),PUSH=(61:ID=1,SEQ=8))
  SORT FIELDS=(62,8,CH,A),EQUALS                                     
                                                                     
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(61,1,ZD,EQ,1),                   
  PUSH=(01:49,12),RECORDS=4),                                       
  IFTHEN=(WHEN=GROUP,BEGIN=(61,1,ZD,EQ,2),PUSH=(13:49,12),RECORDS=3),
  IFTHEN=(WHEN=GROUP,BEGIN=(61,1,ZD,EQ,3),PUSH=(25:49,12),RECORDS=2),
  IFTHEN=(WHEN=GROUP,BEGIN=(61,1,ZD,EQ,4),PUSH=(37:49,12))           
                                                                     
  OUTFIL INCLUDE=(62,8,ZD,GT,1),BUILD=(48X),                         
  REMOVECC,NODETAIL,SECTIONS=(62,8,TRAILER3=(1,48))                 
/*


The output from this job is

Code:

FILE1-REC-01FILE2-REC-01FILE3-REC-01FILE4-REC-01
FILE1-REC-02FILE2-REC-02FILE3-REC-02FILE4-REC-02
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 Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
No new posts FTP datasets to server CLIST & REXX 13
Search our Forums:

Back to Top