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

collecting file name which we are using in the program


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

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Thu Apr 03, 2008 12:19 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Apr 03, 2008 12:36 am
Reply with quote

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
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Thu Apr 03, 2008 10:08 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 03, 2008 11:40 am
Reply with quote

Can I ask why this is a requirement ? What purpose does it serve ?
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Sat Apr 05, 2008 1:00 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Sat Apr 05, 2008 4:36 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Apr 05, 2008 6:26 pm
Reply with quote

why not go the other way around...
instead of retrieving the file names from the jcl,
build the jcl dynamically
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 05, 2008 8:12 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Sat Apr 05, 2008 8:18 pm
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
Search our Forums:

Back to Top