Discussion:
C code to get running job name.
(too old to reply)
John McKown
2018-01-10 13:56:51 UTC
Permalink
Sorry, but I deleted the email which had the original question. Just for
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *psaaold;
char *ascbjbni;
char *ascbjbns;
char *ascbjbn;
char jobname[9];
psaaold=*(char **)0x224; /* address of PSAAOLD */
//printf("%s\n",psaaold);
ascbjbni=*(char **)(psaaold+0xac);
ascbjbns=*(char **)(psaaold+0xb0);
ascbjbn =ascbjbni;
//printf("%s\n",ascbjbni);
if (ascbjbn == NULL) ascbjbn=ascbjbns;
memcpy(jobname,ascbjbn,8);
*(jobname+8)='\0';
printf("%s - %8.8s\n",jobname,ascbjbn);
}
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-10 14:26:42 UTC
Permalink
Why not psatold to TCB, tcbtio to TIOT, then tiocnjob?

I have C code that does that. I would post it here but it is dependent on structs created from SYS1.MACLIB with CDSECT.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Wednesday, January 10, 2018 5:58 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: C code to get running job name.

Sorry, but I deleted the email which had the original question. Just for
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *psaaold;
char *ascbjbni;
char *ascbjbns;
char *ascbjbn;
char jobname[9];
psaaold=*(char **)0x224; /* address of PSAAOLD */
//printf("%s\n",psaaold);
ascbjbni=*(char **)(psaaold+0xac);
ascbjbns=*(char **)(psaaold+0xb0);
ascbjbn =ascbjbni;
//printf("%s\n",ascbjbni);
if (ascbjbn == NULL) ascbjbn=ascbjbns;
memcpy(jobname,ascbjbn,8);
*(jobname+8)='\0';
printf("%s - %8.8s\n",jobname,ascbjbn);
}

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2018-01-10 14:33:21 UTC
Permalink
Post by Charles Mills
Why not psatold to TCB, tcbtio to TIOT, then tiocnjob?
​No reason. I just do it as I do it. Each to his own. In reality, I use
HLASM and the IAZXJSAB or EXTRACT macros to get whatever I can using "well
documented" GUPI interfaces.
Post by Charles Mills
I have C code that does that. I would post it here but it is dependent on
structs created from SYS1.MACLIB with CDSECT.
Charles
-----Original Message-----
Behalf Of John McKown
Sent: Wednesday, January 10, 2018 5:58 AM
Subject: C code to get running job name.
Sorry, but I deleted the email which had the original question. Just for
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *psaaold;
char *ascbjbni;
char *ascbjbns;
char *ascbjbn;
char jobname[9];
psaaold=*(char **)0x224; /* address of PSAAOLD */
//printf("%s\n",psaaold);
ascbjbni=*(char **)(psaaold+0xac);
ascbjbns=*(char **)(psaaold+0xb0);
ascbjbn =ascbjbni;
//printf("%s\n",ascbjbni);
if (ascbjbn == NULL) ascbjbn=ascbjbns;
memcpy(jobname,ascbjbn,8);
*(jobname+8)='\0';
printf("%s - %8.8s\n",jobname,ascbjbn);
}
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 07:14:14 UTC
Permalink
Post by Charles Mills
Why not psatold to TCB, tcbtio to TIOT, then tiocnjob?
Not that I would think this is likely to occur, but if such C code happened to be run as SRB, PSATOLD would be zero. Accessing these fields via PSAAOLD will still work.
--
Peter Hunkeler

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-11 15:51:37 UTC
Permalink
Good point. Thanks. The code in question is unlikely to run as an SRB, but
anything is possible in the future.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On
Behalf Of Peter Hunkeler
Sent: Wednesday, January 10, 2018 11:15 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: C code to get running job name.
Post by Charles Mills
Why not psatold to TCB, tcbtio to TIOT, then tiocnjob?
Not that I would think this is likely to occur, but if such C code happened
to be run as SRB, PSATOLD would be zero. Accessing these fields via PSAAOLD
will still work.
--
Peter Hunkeler

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Thomas David Rivers
2018-01-10 17:19:43 UTC
Permalink
Post by John McKown
Sorry, but I deleted the email which had the original question. Just for
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.
#include <stdlib.h>
#include <stdio.h>
...
In Systems/C , this is simply:

#include <machine/tiot.h>
#include <stdio.h>

main()
{
printf("Job name is %s\n", __jobname());
}



- Dave R. -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
John McKown
2018-01-10 17:25:23 UTC
Permalink
Post by John McKown
Sorry, but I deleted the email which had the original question. Just for
Post by John McKown
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.
#include <stdlib.h>
#include <stdio.h>
...
#include <machine/tiot.h>
#include <stdio.h>
main()
{
printf("Job name is %s\n", __jobname());
}
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions which start with one or two
underscores. These are generally "reserved" for the implementer and so may
not be available on a different compiler. The __jobname() is a nice example
of a reasonable extension for z/OS, or z/VSE. Another nice one might be
__userid() to return the RACF id under which the process is running. ​
Post by John McKown
- Dave R. -
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Thomas David Rivers
2018-01-11 13:18:49 UTC
Permalink
Post by John McKown
Post by Thomas David Rivers
#include <machine/tiot.h>
#include <stdio.h>
main()
{
printf("Job name is %s\n", __jobname());
}
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions which start with one or two
underscores. These are generally "reserved" for the implementer and so may
not be available on a different compiler. The __jobname() is a nice example
of a reasonable extension for z/OS, or z/VSE. Another nice one might be
__userid() to return the RACF id under which the process is running. ​
Hi John,


Yes - identifiers that begin with double-underscore are reserved
for the C implementation; that's why our implementation uses
those (to avoid conflicts.)

Along with __jobname(), we have:

__stepname()
__procname()
__get_cpuid()
__userid()

which can make it very handy indeed. The Dignus C library
manual has more details.

- Dave R. -
--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com
Barkow, Eileen
2018-01-11 13:34:48 UTC
Permalink
__jobname(), __stepname() etc are not documented in the
XL C/C++ Runtime Library Reference Version 2 Release 2 SC14
manual. Where are they documented?



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Thomas David Rivers
Sent: Thursday, January 11, 2018 8:19 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: C code to get running job name.
Post by John McKown
Post by Thomas David Rivers
#include <machine/tiot.h>
#include <stdio.h>
main()
{
printf("Job name is %s\n", __jobname());
}
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions which start with one or two
underscores. These are generally "reserved" for the implementer and so may
not be available on a different compiler. The __jobname() is a nice example
of a reasonable extension for z/OS, or z/VSE. Another nice one might be
__userid() to return the RACF id under which the process is running. ​
Hi John,


Yes - identifiers that begin with double-underscore are reserved
for the C implementation; that's why our implementation uses
those (to avoid conflicts.)

Along with __jobname(), we have:

__stepname()
__procname()
__get_cpuid()
__userid()

which can make it very handy indeed. The Dignus C library
manual has more details.

- Dave R. -

--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


________________________________

This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2018-01-11 13:49:05 UTC
Permalink
Post by Barkow, Eileen
__jobname(), __stepname() etc are not documented in the
XL C/C++ Runtime Library Reference Version 2 Release 2 SC14
manual. Where are they documented?
​Those are part of the C run-time for the _Dignus_ C compiler, not the IBM
run-time. There is no equivalent for the z/OS (IBM)​ compiler.
Post by Barkow, Eileen
-----Original Message-----
Behalf Of Thomas David Rivers
Sent: Thursday, January 11, 2018 8:19 AM
Subject: Re: C code to get running job name.
Post by John McKown
Post by Thomas David Rivers
#include <machine/tiot.h>
#include <stdio.h>
main()
{
printf("Job name is %s\n", __jobname());
}
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions which start with one or two
underscores. These are generally "reserved" for the implementer and so may
not be available on a different compiler. The __jobname() is a nice
example
Post by John McKown
of a reasonable extension for z/OS, or z/VSE. Another nice one might be
__userid() to return the RACF id under which the process is running. ​
Hi John,
Yes - identifiers that begin with double-underscore are reserved
for the C implementation; that's why our implementation uses
those (to avoid conflicts.)
__stepname()
__procname()
__get_cpuid()
__userid()
which can make it very handy indeed. The Dignus C library
manual has more details.
- Dave R. -
--
Get your mainframe programming tools at http://www.dignus.com
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
________________________________
This e-mail, including any attachments, may be confidential, privileged or
otherwise legally protected. It is intended only for the addressee. If you
received this e-mail in error or from someone who was not authorized to
send it to you, do not disseminate, copy or otherwise use this e-mail or
its attachments. Please notify the sender immediately by reply e-mail and
delete the e-mail from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-11 15:24:11 UTC
Permalink
If you need the stepname the code I posted will work, assuming you reference tiocjstn in the last line.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Barkow, Eileen
Sent: Thursday, January 11, 2018 5:36 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: C code to get running job name.

__jobname(), __stepname() etc are not documented in the XL C/C++ Runtime Library Reference Version 2 Release 2 SC14 manual. Where are they documented?



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Thomas David Rivers
Sent: Thursday, January 11, 2018 8:19 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: C code to get running job name.
On Wed, Jan 10, 2018 at 11:19 AM, Thomas David Rivers
Post by Thomas David Rivers
#include <machine/tiot.h>
#include <stdio.h>
main()
{
printf("Job name is %s\n", __jobname()); }
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions which start with one or two
underscores. These are generally "reserved" for the implementer and so may
not be available on a different compiler. The __jobname() is a nice example
of a reasonable extension for z/OS, or z/VSE. Another nice one might be
__userid() to return the RACF id under which the process is running. ​
Hi John,


Yes - identifiers that begin with double-underscore are reserved
for the C implementation; that's why our implementation uses
those (to avoid conflicts.)

Along with __jobname(), we have:

__stepname()
__procname()
__get_cpuid()
__userid()

which can make it very handy indeed. The Dignus C library
manual has more details.

- Dave R. -

--
***@dignus.com Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


________________________________

This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-10 17:41:36 UTC
Permalink
Post by John McKown
Post by Thomas David Rivers
printf("Job name is %s\n", __jobname());
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions ... Another nice one might be
__userid() to return the RACF id under which the process is running. ​
With the right header files, that's just a couple calls to getuid(); getpwuid();

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2018-01-10 17:47:53 UTC
Permalink
On Wed, Jan 10, 2018 at 11:42 AM, Paul Gilmartin <
Post by Paul Gilmartin
Post by John McKown
Post by Thomas David Rivers
printf("Job name is %s\n", __jobname());
That is a nice enhancement for the C language under z/OS. As a general
rule, I _try_ to avoid any functions ... Another nice one might be
__userid() to return the RACF id under which the process is running. ​
With the right header files, that's just a couple calls to getuid(); getpwuid();
​Could be a bit "iffy" in the case of UID==0 if multiple RACF IDs have
UID(0) specified. I know that a lot of shops run this way (BPXROOT,
OMVSKERN, TCPIP, and maybe others). I checked and Dignus/C does have a
__userid() and a __procstep() and __stepname() as well. The only reason I
can think of to have these would be for "logging" purposes.​
Post by Paul Gilmartin
-- gil
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Barkow, Eileen
2018-01-10 21:04:01 UTC
Permalink
Thanks again John. I will try it out.

The problem is when a program is started from OMVS under a USERID and runs under a different name, which makes it
difficult for someone to cancel the job or issue modify commands against it.
The system keeps appending numerical values to the USERID and you have to do a DA userid* command to find what it is.
I just want to be able to display the actual JOBNAME to the console.

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Wednesday, January 10, 2018 8:58 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: C code to get running job name.

Sorry, but I deleted the email which had the original question. Just for
"fun" (but no profit), I wrote the following C code to display the name of
the job under which the program is running. It can be improved a bit, but
it shows the basics.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *psaaold;
char *ascbjbni;
char *ascbjbns;
char *ascbjbn;
char jobname[9];
psaaold=*(char **)0x224; /* address of PSAAOLD */
//printf("%s\n",psaaold);
ascbjbni=*(char **)(psaaold+0xac);
ascbjbns=*(char **)(psaaold+0xb0);
ascbjbn =ascbjbni;
//printf("%s\n",ascbjbni);
if (ascbjbn == NULL) ascbjbn=ascbjbns;
memcpy(jobname,ascbjbn,8);
*(jobname+8)='\0';
printf("%s - %8.8s\n",jobname,ascbjbn);
}

--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


________________________________

This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 08:07:38 UTC
Permalink
The problem is when a program is started from OMVS under a USERID and runs under a different name, which makes it difficult for someone to cancel the job or issue modify commands against it.
The system keeps appending numerical values to the USERID and you have to do a DA userid* command to find what it is.
I just want to be able to display the actual JOBNAME to the console.
If you really want to be of help to the operators, include the ASID in the display. Remember that the suffix is single digit and wraps from 9 to 1, and multiple of those may be active in the system at any one time.


--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-10 21:22:49 UTC
Permalink
Post by Barkow, Eileen
Thanks again John. I will try it out.
The problem is when a program is started from OMVS under a USERID and runs under a different name, which makes it
difficult for someone to cancel the job or issue modify commands against it.
The system keeps appending numerical values to the USERID and you have to do a DA userid* command to find what it is.
I just want to be able to display the actual JOBNAME to the console.
Ouch! Of course, fork() creates a new job (sort of) with a different job name (really).

How will this play with 8-character userids?

There's no rule that JOBNAMEs must be prefixed with userid.

How does cancelling the parent job affect its children? Might they continue running?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2018-01-10 21:29:32 UTC
Permalink
On Wed, Jan 10, 2018 at 3:24 PM, Paul Gilmartin <
Post by Barkow, Eileen
Post by Barkow, Eileen
Thanks again John. I will try it out.
The problem is when a program is started from OMVS under a USERID and
runs under a different name, which makes it
Post by Barkow, Eileen
difficult for someone to cancel the job or issue modify commands against
it.
Post by Barkow, Eileen
The system keeps appending numerical values to the USERID and you have to
do a DA userid* command to find what it is.
Post by Barkow, Eileen
I just want to be able to display the actual JOBNAME to the console.
Ouch! Of course, fork() creates a new job (sort of) with a different job name (really).
​Unless the jobname is already 8 characters. In that case, then fork()'d
address space has the same name as the parent.​
Post by Barkow, Eileen
How will this play with 8-character userids?
​Userids have nothing to do with job names, in general. If a user logs into
a UNIX shell, the UNIX process runs in a new STC whose name is based on the
USERID plus 1 character (sort of "random"). I am _guessing_ that with an 8
character RACF id, the UNIX process runs in an STC with the 8 character
RACF ID.​
Post by Barkow, Eileen
There's no rule that JOBNAMEs must be prefixed with userid.
​Very true.​
Post by Barkow, Eileen
How does cancelling the parent job affect its children? Might they continue running?
​Just like with any other UNIX. The fork()'d address space (child)
continues to run independently of the parent's life. If the parent
terminates, then the BPXOINIT address space becomes the child's new UNIX
parent. Just like in any other UNIX, the child is "inherited" by PID==1.​
Post by Barkow, Eileen
-- gil
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 07:43:01 UTC
Permalink
​>Userids have nothing to do with job names, in general. If a user logs into
a UNIX shell, the UNIX process runs in a new STC whose name is based on the
USERID plus 1 character (sort of "random"). I am _guessing_ that with an 8
character RACF id, the UNIX process runs in an STC with the 8 character
RACF ID.​


Not in my experience. When logging into a shell, sshd (and I believe otelnetd as well) sets the _BPX_JOBNAME variable before spanwing the shell process. An its the plain userid that is being set.


--
Peter Hunkeler


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
John McKown
2018-01-11 13:20:35 UTC
Permalink
Post by Peter Hunkeler
​>Userids have nothing to do with job names, in general. If a user logs into
a UNIX shell, the UNIX process runs in a new STC whose name is based on the
USERID plus 1 character (sort of "random"). I am _guessing_ that with an 8
character RACF id, the UNIX process runs in an STC with the 8 character
RACF ID.​
Not in my experience. When logging into a shell, sshd (and I believe
otelnetd as well) sets the _BPX_JOBNAME variable before spanwing the shell
process. An its the plain userid that is being set.
Ah, you're right. It's when I execute a command from the shell that the
digit is added to the end of the "jobname". I.e. the shell itself runs
under "USERID", but when I do a "sleep 60s", the sleep command runs under
"USERID1" (for example).
Post by Peter Hunkeler
--
Peter Hunkeler
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 15:23:09 UTC
Permalink
Post by John McKown
Ah, you're right. It's when I execute a command from the shell that the
digit is added to the end of the "jobname". I.e. the shell itself runs
under "USERID", but when I do a "sleep 60s", the sleep command runs under
"USERID1" (for example).



Every command that the shell fork()s will run in a separate AS, so the jobname rules apply. Also, every command the shell spawn()s when _BPX_SHAREAS is neither "YES" nor "MUST", and spawn cannot honour it, will run in a separate AS, so the rules apply. Commands run as local process, i.e. spawn() can honour "YES" or "MUST", will run in the same AS, so under the same jobname.


--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 07:30:04 UTC
Permalink
Post by Paul Gilmartin
How will this play with 8-character userids?
The same way as it already does and always did with 8-character jobname: The jobname is not modified.
Post by Paul Gilmartin
There's no rule that JOBNAMEs must be prefixed with userid.
But fork() and non-local spawn() need a rule to build a jobname for the new process address space.
Post by Paul Gilmartin
How does cancelling the parent job affect its children? Might they continue running?
The same way it works on any unix: Child processed are terminated when the parent terminates.



--
Peter Hunkeler


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-11 07:38:35 UTC
Permalink
Post by Peter Hunkeler
Post by Paul Gilmartin
How does cancelling the parent job affect its children? Might they continue running?
The same way it works on any unix: Child processed are terminated when the parent terminates.
The above statement is wrong. I mixed this up with special shell behaviour. The shell terminates its children, except when nohup is used.
Sorry for that.


--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...