View previous topic :: View next topic
|
Author |
Message |
maheshvamsi
New User
Joined: 22 Mar 2008 Posts: 39 Location: bangalore
|
|
|
|
Hi all,
Is it possible to get the File name which are used in the program to another file.
//STEP EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=FILE.1
// DD DISP=SHR,DSN=FILE.2
// DD DISP=SHR,DSN=FILE.3
// DD DISP=SHR,DSN=FILE.4
// DD DISP=SHR,DSN=FILE.5
//SYSUT2 DD DISP=SHR,DSN=FILE.X
I want to get name of all files which are used in the SYSUT1 step to a new file.
Please explain me if the above scenario is possible. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello mahesh and welcome to the forums,
Quote: |
I want to get name of all files which are used in the SYSUT1 step to a new file. |
Please explain what this is asking.
Showing an example would probably help. |
|
Back to top |
|
|
maheshvamsi
New User
Joined: 22 Mar 2008 Posts: 39 Location: bangalore
|
|
|
|
Hi dick,
I have to insert all the files in to the table which are processed. So if we can copy the file names which are used in SYSUT1 to any fileX, i can write a cobol program which reads fileX and inserts a row in the table.
if you have any better suggestion please suggest me. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Can I ask why this is a requirement ? What purpose does it serve ? |
|
Back to top |
|
|
maheshvamsi
New User
Joined: 22 Mar 2008 Posts: 39 Location: bangalore
|
|
|
|
Hi,
sorry for late replay,
I AM WORKING IN SUPPORT, SOME TIME WE WILL GET 5 OR 6 FILES FOR PROCESSING ONE STREAM,
ONCE WE GET THESE FILES WE HAVE TO DO LOT OF MANUAL WORK, THE MAIN INTENSION OF ME IS TO REMOVE ALL THE MANUAL WORK WHICH WE ARE DOING.
I WILL EXPLAIN THE WORK BELOW.
1. ONCE WE GET ALL 5 FILES WE HAVE TO INSERT THESE FILES INTO ONE TABLE & THESE FILE ARE PICKED UP BY ONE OF OUR JOB STREAM(IT IS CONFIDENTIAL THAT'S WHY I AM NOT EXPLAINING FULLY)
2. WE HAVE TO CHECK ONE DATE PARAMETER MANUALLY IN ALL FIVE FILES
3. WE HAVE TO CHECK ONE parameter is SET to A OR C AS PER OUR REQUIREMENT.
4. ONE WE DID ALL THE THINGS IF WE FOUND ANY THING WRONG, WE HAVE TO GET BACK TO REQUESTOR FOR ASKING CORRECT INFORMATION.
THESE THINGS WILL TAKE NEARLY 50 MIN.
SO WHAT I AM PLANNING TO DO IS
WHEN WE GET REQUEST
1. I WILL COMBINE THEM TO ONE FILE BY USING IEBGENER
2. I WILL DISPLAY DIFFERENT DATES WHICH ARE USED IN THE DISPLAY FILED BY USING SORT (i GOT THIS INFORMATION IN THE SOME TOPICS WHICH ARE DIsCUSSED IN THE FORUM) -- WHICH WILL SATISFY ABOVE REQUIREMENT 2
3. FOR REQUIREMENT 3 I WILL USE SAME AS ABOVE
4. FOR FUFILLING FIRST REQUIREMENT I AM FACING SOME PROBLEM. IF WE GET ALL THE FILES IN TO ONE DATASET, BY USING COBOL PROGRAM I CAN WRITE IT INTO THE TABLES(U CAN SUGGEST ME IF ANY OTHER EASY WAY ALSO)
IF THERE IS ANY OTHER EASY WAY ALSO U CAN SUGGEST ME .
THANKS IN ADVANCE. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
mahesh,
As your intention is to reduce the manual effort in getting the DD names, i would go for REXX for this requirement.
Store this JCL in a file and read it into a stem variable using DISKR command.
Then search the stem for SYSUT1 and move the file name to a QUEUE. DO this until you find SYSUT2.
Finally write the QUEUE into a file which would have all the file names. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why not go the other way around...
instead of retrieving the file names from the jcl,
build the jcl dynamically |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Another possible approach:
From SDSF, XDC the JCL to a file (PS or PDS - don't use SJ if the DDs can contain symbolics. BTW, the symbolics may affect Aaru's solution too), then edit the file to produce the desired table. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
mmwife,
Yep, you are correct.
mahesh,
If your JCL has got symbolics then u can use SDSF in batch to get the filenames (you can use SDSF in batch to copy the contents of any DD) and then add logic in REXX to get the list of the input files. |
|
Back to top |
|
|
|