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
 
Need to merge more than 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to merge more than 2 files
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

Moderator Team Head


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

PostPosted: Wed Jan 06, 2010 8:05 pm    Post subject: Reply to: Need to merge more than 2 files
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    Post subject:
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jan 06, 2010 8:13 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Jan 06, 2010 8:20 pm    Post subject: Reply to: Need to merge more than 2 files
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM 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