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

Need to merge more than 2 files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nirmal arthur

New User


Joined: 26 Jun 2008
Posts: 8
Location: Hyderabad

PostPosted: Wed Jan 06, 2010 7:59 pm
Reply with quote

We have a requirement where we are supposed to merge two or more sequential files. The catch is that the file names are present in a table. Is there any way I can extract the file names using an unload JCL (INZUTILB) and use a sort to merge the files all without using a program. The problem here is I don't know how to get the file names present in the unloaded sequential file to the DD statement in the SORT step. Is there any way I can do this?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 06, 2010 8:05 pm
Reply with quote

The two thoughts I have are either using IDCAMS to make a copy of those datasets to work or temp datasets, or dynamically generating the JCL and/or the proper DD statements to be used in a subsequent job.

It would be helpful if you could maybe let us know what your thoughts are and what standards or restrictions you may need to abide by.
Back to top
View user's profile Send private message
nirmal arthur

New User


Joined: 26 Jun 2008
Posts: 8
Location: Hyderabad

PostPosted: Wed Jan 06, 2010 8:08 pm
Reply with quote

We cannot use a subsequent job. Can you please eloberate on the IDCAMS approach.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 06, 2010 8:13 pm
Reply with quote

Quote:
The problem here is I don't know how to get the file names present in the unloaded sequential file to the DD statement in the SORT step
If you cannot use a second job, you must either use dynamic allocation of the files (supported in COBOL and Assembler, for example) or tell whoever gave you the assignment that it cannot be completed as specified. The big problem is that JCL, once submitted to JES and run through the Converter / Interpreter, is fixed in stone and cannot be changed in any way, shape, style or form for any reason whatsoever. So you cannot (I repeat, can not) have a job where the first step modifies the JCL used in the second (or subsequent) step -- since that JCL has been fixed by JES and is unchangeable.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 06, 2010 8:20 pm
Reply with quote

You can use the IDCAMS REPRO command to copy from a cataloged dataset to either another cataloged dataset or to an associated DD statement:

REPRO IDS(INPUT.DATASET) ODS(OUTPUT.DATASET)

or

REPRO IDS(INPUT.DATASET) OFILE(DDNAME)

30.1 REPRO Parameters.
Back to top
View user's profile Send private message
nirmal arthur

New User


Joined: 26 Jun 2008
Posts: 8
Location: Hyderabad

PostPosted: Wed Jan 06, 2010 8:39 pm
Reply with quote

Thanks a lot!
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 -> JCL & VSAM

 


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