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

Determine what library member is in, and pass it as variable


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

New User


Joined: 23 Jul 2020
Posts: 1
Location: United States

PostPosted: Thu Jul 23, 2020 3:02 am
Reply with quote

We have to use unique PDS(s) to execute JCL.
What I want to do is:
Determine what "PDS" that the JCL is being executed from and then
pass that to a program.

I know how to pass a parameter to the program; just don't know how to determine what unique PDS the JCL is being executed from
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Jul 23, 2020 1:14 pm
Reply with quote

If the program that the parameter is being passed to is in the same jobstream then you cannot do it as the jobstream is fixed once it is submitted. However, if you can determine the source PDS of your JCL then that could be written to a dataset which could be read by that program.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Jul 23, 2020 9:07 pm
Reply with quote

Another insane "requirement" by a PHB?

There is no way for a job to find out from which PDS it has been submitted, unless the job starts with a program that reads SMF records.
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: Thu Jul 23, 2020 9:24 pm
Reply with quote

There is a relationship between the load library the program executes from that can (usually) be identified, but as far as the JCL source -- there is nothing I know of in the system that will tie JCL source to an executing program. The same JCL can be executed from multiple PDS and there's nothing to indicate which was used. And when debugging started task issues, system programmers will slap a job card on the PROC, save it in their PDS and submit it as a normal job to get additional information; this tells you that there is no way to tie a JCL stream to a particular PDS.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Jul 23, 2020 11:01 pm
Reply with quote

Write a Rexx or Google it . That will give you the PDS and pass that as input to your program.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Jul 24, 2020 2:21 pm
Reply with quote

I'm not sure how you Google and get the results in a running batch program.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Jul 24, 2020 10:26 pm
Reply with quote

Obliviously, if Rexx is unknown then Search on Google "How to do thru Rexx to get the PDS your are in?" is what I meant to make it more clear.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sat Jul 25, 2020 2:22 pm
Reply with quote

As far as i remember one could find the jcllibrary from which jcl was extracted in the job log.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat Jul 25, 2020 5:36 pm
Reply with quote

PeterHolland wrote:
As far as i remember one could find the jcllibrary from which jcl was extracted in the job log.
That's the library from which a cataloged procedure is obtained. I think the topic starter wants information about where the job came from. In other words, if a job is submitted using JCL like this -
Code:
//        EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  ...,DSN=library(member)
//SYSUT2   DD  SYSOUT=(A,INTRDR)
the topic starter wants library and member.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Jul 26, 2020 2:58 pm
Reply with quote

Quote:
That's the library from which a cataloged procedure is obtained


True, where I worked all production JCL was submitted from cataloged procedure libraries. All JCL submission from "own" libraries was not allowed, except on test systems.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Calling an Open C library function in... CICS 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top