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
 
Combining datasets into one

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject:
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

Site Director


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

PostPosted: Wed Apr 29, 2009 8:40 pm    Post subject:
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    Post subject:
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    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 REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm

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