View previous topic :: View next topic
|
Author |
Message |
nirmal arthur
New User
Joined: 26 Jun 2008 Posts: 8 Location: Hyderabad
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
nirmal arthur
New User
Joined: 26 Jun 2008 Posts: 8 Location: Hyderabad
|
|
|
|
We cannot use a subsequent job. Can you please eloberate on the IDCAMS approach. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
nirmal arthur
New User
Joined: 26 Jun 2008 Posts: 8 Location: Hyderabad
|
|
|
|
Thanks a lot! |
|
Back to top |
|
|
|