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

JCL Dynamic System Symbols


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

Senior Member


Joined: 29 Apr 2008
Posts: 2020
Location: USA

PostPosted: Fri May 26, 2023 8:53 pm
Reply with quote

The manual says:
Quote:
&JOBNAME
The name of the job. Shown in 1-8 characters. In the special case when the job name is *MASTER*, &JOBNAME resolves to #MASTER# to avoid the error of using the asterisk as part of a data set name.
Under z/OS®, it is valid to define a user ID that is all numeric. Under z/OS UNIX, this all-numeric user ID might be propagated as a job name in the case of a fork() or non-local spawn(); this can lead to allocation failures when &JOBNAME is used in substitution for a data set name.

If you specify the &JOBNAME dynamic system symbol in a START command for a started task, the resolved substitution text for &JOBNAME is the name of the job assigned to the address space that calls the symbolic substitution service, not the address space of the started task.


But when used with regular JCL submit from ISPF, the result is not the name from the JOB statement, but always as if it was set:
Code:
// SET JOBNAME='JES2'


Any idea?
Back to top
View user's profile Send private message
Leonard Peters

New User


Joined: 08 Aug 2023
Posts: 2
Location: United States

PostPosted: Tue Aug 08, 2023 2:16 am
Reply with quote

I don't know if you have figured it out but, a simple solution would be to have a Set job='abcjob1' you would just create a symbolic called JOB or whatever you wanted. Then you could include it in file names or even //sysin dd *,SYMBOLS=JCLONLY (If you want to pass it to a pgm or utility)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2020
Location: USA

PostPosted: Tue Aug 08, 2023 2:42 am
Reply with quote

Leonard Peters wrote:
I don't know if you have figured it out but, a simple solution would be to have a Set job='abcjob1' you would just create a symbolic called JOB or whatever you wanted. Then you could include it in file names or even //sysin dd *,SYMBOLS=JCLONLY (If you want to pass it to a pgm or utility)

OMG!…

Of course I can set MY OWN variables, as many as I want.

The question is completely different: why the standard dynamic JCL symbol supposed to define the job name, instead of its definition is always set to constant ‘JES2’?
Marie Antoinette wrote:
Do you have no bread? No problem! You can eat cakes instead!
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1247
Location: Bamberg, Germany

PostPosted: Thu Aug 10, 2023 1:14 pm
Reply with quote

Quote:
If you specify the &JOBNAME dynamic system symbol in a START command for a started task, the resolved substitution text for &JOBNAME is the name of the job assigned to the address space that calls the symbolic substitution service, not the address space of the started task.

The AS that seems to call the symbolic substitution service will always be JES2 here, hence the result. I have no other explanation, even thou it might not be fully covered by the manuals description yet.
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 Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
Search our Forums:

Back to Top