Re: I/O Control Blocks Below 16MB (Was: Who loaded me?)

2012-12-11 Thread Shmuel Metz (Seymour J.)
In 50c4b54e.70...@phoenixsoftware.com, on 12/09/2012
   at 07:59 AM, Edward Jaffe edja...@phoenixsoftware.com said:

I assume this is for non-reentrant code only.

Certainly non-refreshable, and probably non-reentrant in most cases.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-09 Thread John McKown
Thanks for the info. I have heard of scatter load, but only in context
with the NUCLEUS. Interesting that RMODE(SPLIT) is, at least
conceptually, similar. I use RMODE(SPLIT) all the time to put my I/O
CSECTs into RMODE(24) storage, while leaving the other CSECTs in
RMODE(31) storage.


Now if I could just eliminate DCBs entirely.

On Sat, 2012-12-08 at 18:46 -0500, Shmuel Metz (Seymour J.) wrote:
 In a6b9336cdb62bb46b9f8708e686a7ea0116565f...@nrhmms8p02.uicnrh.dom,
 on 12/07/2012
at 07:12 AM, McKown, John john.mck...@healthmarkets.com said:
 
 The only thing I could find was the macro, and it was vague to me 
 as to whether this was an array of entries or just a single entry.
 
 The control block goes back to OS/360, when scatter load was still
 supported by Fetch, so it had to be an array of extents. In z/OS, of
 course, you have split modules, so the requirement has reappeared in
 another guise.
 

-- 
John McKown
Maranatha! 

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


I/O Control Blocks Below 16MB (Was: Who loaded me?)

2012-12-09 Thread Edward Jaffe

On 12/9/2012 7:19 AM, John McKown wrote:

I use RMODE(SPLIT) all the time to put my I/O
CSECTs into RMODE(24) storage, while leaving the other CSECTs in
RMODE(31) storage.


I assume this is for non-reentrant code only. Of course, DCBs and DECBs must 
still reside below 16MB (that usually works out to somewhere around 100 bytes of 
LOC=24 virtual storage per file--a little more if you use exit lists). But, 
there is no need for the code that performs OPEN, CLOSE, GET, PUT, READ, WRITE, 
or even EXCP or STARTIO to be RMODE(24).


--
Edward E Jaffe
Phoenix Software International, Inc
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

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


Re: I/O Control Blocks Below 16MB (Was: Who loaded me?)

2012-12-09 Thread John McKown
Hum. Yes, non-rent and data only. I actually have CSECTs which only
contain data. If one of my data CSECTs contain RMODE(24) things such
as DCBs, then I mark them RMODE(24). I now try very hard to write all my
HLASM as pure or non-self-modify code segments which could be loaded
into key 0, read only storage and still run correctly. All my current
code is also written as LE enabled, unless it is for something where LE
is not possible, such as an z/OS exit.

On Sun, 2012-12-09 at 07:59 -0800, Edward Jaffe wrote:
 On 12/9/2012 7:19 AM, John McKown wrote:
  I use RMODE(SPLIT) all the time to put my I/O
  CSECTs into RMODE(24) storage, while leaving the other CSECTs in
  RMODE(31) storage.
 
 I assume this is for non-reentrant code only. Of course, DCBs and DECBs must 
 still reside below 16MB (that usually works out to somewhere around 100 bytes 
 of 
 LOC=24 virtual storage per file--a little more if you use exit lists). But, 
 there is no need for the code that performs OPEN, CLOSE, GET, PUT, READ, 
 WRITE, 
 or even EXCP or STARTIO to be RMODE(24).
 

-- 
John McKown
Maranatha! 

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


Re: I/O Control Blocks Below 16MB (Was: Who loaded me?)

2012-12-09 Thread John Gilmore
I do not understand why a data-only RSECT is not marked RENT or,
better, REFR,  for inclusion in a RENT or REFR program object.

John Gilmore, Ashland, MA 01721 - USA

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


Re: Who loaded me?

2012-12-08 Thread Shmuel Metz (Seymour J.)
In a6b9336cdb62bb46b9f8708e686a7ea0116565f...@nrhmms8p02.uicnrh.dom,
on 12/07/2012
   at 07:12 AM, McKown, John john.mck...@healthmarkets.com said:

The only thing I could find was the macro, and it was vague to me 
as to whether this was an array of entries or just a single entry.

The control block goes back to OS/360, when scatter load was still
supported by Fetch, so it had to be an array of extents. In z/OS, of
course, you have split modules, so the requirement has reappeared in
another guise.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-06 Thread Shmuel Metz (Seymour J.)
In a6b9336cdb62bb46b9f8708e686a7ea0116565f...@nrhmms8p02.uicnrh.dom,
on 12/05/2012
   at 02:08 PM, McKown, John john.mck...@healthmarkets.com said:

The CDE contains the load point of the program and its length.

It didn't use to. Are you sure that you aren't thinking of the entry
point address rather than the load addreess?

Make sure the PSW is within this address range.

Which address range? The module might be split.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-06 Thread Shmuel Metz (Seymour J.)
In 50c00985.6070...@valley.net, on 12/05/2012
   at 09:57 PM, Gerhard Postpischil gerh...@valley.net said:

True, but irrelevant. A user program locating its JSTCB isn't going
to  see the system tasks unless it chases beyond its own JSTCB, 
which was not required to satisfy the original post.

The TMP does not attach commands in a separate JS.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-06 Thread McKown, John
My mistake. A major CDE points to a XTLST, IHAXTLST macro, which contains the 
load point and length. Interesting question on RMODE(SPLIT). Guess I'll need to 
code up something and ABEND it to get a dump to see what I can see.

-- 
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
john.mck...@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM


 -Original Message-
 From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU]
 On Behalf Of Shmuel Metz (Seymour J.)
 Sent: Thursday, December 06, 2012 5:35 AM
 To: IBM-MAIN@LISTSERV.UA.EDU
 Subject: Re: Who loaded me?
 
 In a6b9336cdb62bb46b9f8708e686a7ea0116565f...@nrhmms8p02.uicnrh.dom,
 on 12/05/2012
at 02:08 PM, McKown, John john.mck...@healthmarkets.com said:
 
 The CDE contains the load point of the program and its length.
 
 It didn't use to. Are you sure that you aren't thinking of the entry
 point address rather than the load addreess?
 
 Make sure the PSW is within this address range.
 
 Which address range? The module might be split.
 
 --
  Shmuel (Seymour J.) Metz, SysProg and JOAT
  Atid/2http://patriot.net/~shmuel
 We don't care. We don't have to care, we're Congress.
 (S877: The Shut up and Eat Your spam act of 2003)
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions, send
 email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: Who loaded me?

2012-12-06 Thread Edward Jaffe

On 12/6/2012 2:09 PM, McKown, John wrote:

My mistake. A major CDE points to a XTLST, IHAXTLST macro, which contains the 
load point and length. Interesting question on RMODE(SPLIT). Guess I'll need to 
code up something and ABEND it to get a dump to see what I can see.


XTLST is an extent *list* -- both extents are shown.

--
Edward E Jaffe
Phoenix Software International, Inc
831 Parkview Drive North
El Segundo, CA 90245
http://www.phoenixsoftware.com/

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Peter, thanks, this is pretty much what I am looking for.

Perhaps (thinking of the other responses) I was not sufficiently clear. I am
not trying to write an encapsulated function which is guaranteed to solve
this problem for any case. I have a particular program that may need to
behave differently if it was invoked by X as opposed to under all other
circumstances; or perhaps needs to behave differently if it was loaded by
something else as opposed to being the jobstep program.

Does JSCBPGMN = me? Does JSCBPGMN = X? The answers to those questions
are probably all I need.

Thanks much.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Peter Relson
Sent: Wednesday, December 05, 2012 4:36 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

JSCBPGMN is the job step program name. If the question is is am I a
program whose name matches the job step program name then that field can be
used to answer. Note that I intentionally did not say am I the program
because that can be very very hard to determine, if there are multiple
programs with the same name that are available to be fetched.

Most (intended) started tasks do, for example, for system integrity reasons,
check was I started as a started task and if not they exit because they
are being invoked in an unexpected and unsupported (and potentially
malicious) environment . That can be determined using EXTRACT and COMCIBPT
and CIBVERB=X'04' .

If you were linked to or attached there is information via the RB chain and
RBCDE (not a programming interface) which (potentially) locates a CDE or
LPDE which will have a program name.

As mentioned, if you were load'd and call'd, there are no programming
interfaces that will tell you who loaded. 

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


Re: Who loaded me?

2012-12-05 Thread Bill Fairchild
There is also much discussion of this same topic in the IBM-MAIN archives, q. v.

Bill Fairchild
Programmer
Rocket Software
408 Chamberlain Park Lane * Franklin, TN 37069-2526 * USA
t: +1.617.614.4503 *  e: bfairch...@rocketsoftware.com * w: 
www.rocketsoftware.com


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Charles Mills
Sent: Wednesday, December 05, 2012 7:30 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Peter, thanks, this is pretty much what I am looking for.

Perhaps (thinking of the other responses) I was not sufficiently clear. I am 
not trying to write an encapsulated function which is guaranteed to solve this 
problem for any case. I have a particular program that may need to behave 
differently if it was invoked by X as opposed to under all other 
circumstances; or perhaps needs to behave differently if it was loaded by 
something else as opposed to being the jobstep program.

Does JSCBPGMN = me? Does JSCBPGMN = X? The answers to those questions are 
probably all I need.

Thanks much.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Peter Relson
Sent: Wednesday, December 05, 2012 4:36 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

JSCBPGMN is the job step program name. If the question is is am I a program 
whose name matches the job step program name then that field can be used to 
answer. Note that I intentionally did not say am I the program
because that can be very very hard to determine, if there are multiple programs 
with the same name that are available to be fetched.

Most (intended) started tasks do, for example, for system integrity reasons, 
check was I started as a started task and if not they exit because they are 
being invoked in an unexpected and unsupported (and potentially
malicious) environment . That can be determined using EXTRACT and COMCIBPT and 
CIBVERB=X'04' .

If you were linked to or attached there is information via the RB chain and 
RBCDE (not a programming interface) which (potentially) locates a CDE or LPDE 
which will have a program name.

As mentioned, if you were load'd and call'd, there are no programming 
interfaces that will tell you who loaded. 

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

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


Re: Who loaded me?

2012-12-05 Thread John Gilmore
Bill Fairchild is guilty of meiosis, the antonym of hyperbole.  There
is very much too much discussion of this topic in the archives.

It is of course possible to get answers to carefully circumscribed
special cases of this question of the sort Charles Mills is seeking.
There are no general/generic answers to it, and the prospects for one
are bleak.

John Gilmore, Ashland, MA 01721 - USA

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Thanks, John.

It is so easy and facile to say RTFM.

Yeah, sure, it's in the archives. So is everything else.

When I lived in NYC in the sixties, I had a friend who had this idea of
selling the police a list of everyone in Manhattan who smoked dope. It was
the Manhattan phone book.

I have a program that will tell you anyone's RACF password. It's a random
password generator. If you click it enough times it will generate the
password you are looking for.

RTFM is an appropriate response in many cases, but it is vastly overused as
a smug put-down. If a friend asked you what time it was, would you tell him
there was a clock in a room down the hall, or would you look at your wrist
and tell him the damned time?

I suspected someone would know the answer to my fairly simple question of
the top of their heads, and I was right, Peter Relson did. If you don't have
an easy answer off the top of your head, or you're too busy to respond, you
are free to ignore a question. Put-downs are not necessary.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of John Gilmore
Sent: Wednesday, December 05, 2012 7:56 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Bill Fairchild is guilty of meiosis, the antonym of hyperbole.  There is
very much too much discussion of this topic in the archives.

It is of course possible to get answers to carefully circumscribed special
cases of this question of the sort Charles Mills is seeking.
There are no general/generic answers to it, and the prospects for one are
bleak.

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Okay, I'm getting this nailed down. To review, I am not writing a general
purpose function and can safely ignore all of the weird cases like two
programs with the same name from different load libraries. We can assume
true z/OS batch (not STC or anything Unix-ey). Let's ignore any 64-bit
considerations. No AR mode.

I can live with an answer to the following either/or question: am I the
jobstep program, or did someone else load (in a generic sense of the word
load) me? I can't make the simplifying assumption that I know my own name
because customers may have renamed me (more likely than it usually would
be for reasons that are beyond the scope of this discussion). Either me or
the (other) jobstep program might be in the LPA. 

I don't see any examples for CSVQUERY. Am I missing something?

Anyway, here is my plan. Comments?

Issue CSVQUERY
INADDR=ptr_to_any_addr_in_my_pgm,SEARCH=JPALPA,SEARCHMINOR=NO,OUTEPNM=eight_
char_fld_in_writable_storage

(I know some of those parms are defaults; I'm just being extra clear.) Given
RC=0, that gets me my name. Do I need anything else on CXVQUERY other than
the usual MF= considerations? Am I safe ignoring PLISTVER and any other
parameters?

Compare the returned name to JSCBPGMN from my TCB. If they are equal, it is
the I am the jobstep program case; else it is the somebody must have
loaded me case.

Thanks,
Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Peter Relson
Sent: Wednesday, December 05, 2012 4:36 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

JSCBPGMN is the job step program name. If the question is is am I a
program whose name matches the job step program name then that field can be
used to answer. Note that I intentionally did not say am I the program
because that can be very very hard to determine, if there are 

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


Re: Who loaded me?

2012-12-05 Thread Shmuel Metz (Seymour J.)
In 076601cdd26d$7bc24590$7346d0b0$@mcn.org, on 12/04/2012
   at 02:19 PM, Charles Mills charl...@mcn.org said:

1. What would be the best way for a program running z/OS batch to
answer the question Am I the jobstep program, the PGM= program, 
or was I LOADed and CALLed or ATTACHed (let's ignore XCTL for now) 
by another program?

The TCBJSTCB field of the current TCB points to the J/S TCB. The
Initiator attaches PGM=foo as a jobstep.

2. In addition, if the answer to (1.) is another program, where
would I find its entry point name?

Use CSVQUERY to identify the current program. 

In other words, who loaded me? 

Those are two unrelated questions. There is no API to determine who
did the LOAD for a loaded module.

Do you also want to know who did a CALL or LINK?

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-05 Thread Shmuel Metz (Seymour J.)
In 50bea8f7.1060...@valley.net, on 12/04/2012
   at 08:52 PM, Gerhard Postpischil gerh...@valley.net said:

The PGM= entry is the jobstep program, unless you're processing a TSO
 command (but you specified batch...).

Even under TSO, PGM=IKJEFT01 is in a J/S task.

He'll need more detail to do SA and RB chasing.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Who loaded me?

2012-12-05 Thread McKown, John
Just a thought on this. As you say, check that the TCB under which the code is 
executing is the JSTCB. Next, make sure that the RB back chain points back to 
the TCB. This means that it is the only RB on the chain and that you are not 
running via a LINK instruction. But you might be running on the first RB, but 
invoked via a BALR/BASR where the executable code was brought in with a LOAD 
and the EPA stored away. In that case, get the CDE pointer from the RB. The CDE 
contains the load point of the program and its length. Make sure the PSW is 
within this address range. If not, then you were not executed via a PGM= . 
Unfortunately, I cannot figure out an easy way to determine if you were invoked 
via an XCTL.

I guess the OP's question, as I might rephrase it would be: How can I test to 
see if the currently executing code is being run under the first, and only, RB 
on the TCB's RB chain and that the TCB is the job step TCB? Answering this 
would eliminate use of ATTACH, LINK, LOAD/BALR|BASR, SYNC. It only leaves XTCL.

-- 
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
john.mck...@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM


 -Original Message-
 From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU]
 On Behalf Of Shmuel Metz (Seymour J.)
 Sent: Wednesday, December 05, 2012 9:01 AM
 To: IBM-MAIN@LISTSERV.UA.EDU
 Subject: Re: Who loaded me?
 
 In 076601cdd26d$7bc24590$7346d0b0$@mcn.org, on 12/04/2012
at 02:19 PM, Charles Mills charl...@mcn.org said:
 
 1. What would be the best way for a program running z/OS batch to
 answer the question Am I the jobstep program, the PGM= program, or
 was
 I LOADed and CALLed or ATTACHed (let's ignore XCTL for now) by another
 program?
 
 The TCBJSTCB field of the current TCB points to the J/S TCB. The
 Initiator attaches PGM=foo as a jobstep.
 
 2. In addition, if the answer to (1.) is another program, where
 would
 I find its entry point name?
 
 Use CSVQUERY to identify the current program.
 
 In other words, who loaded me?
 
 Those are two unrelated questions. There is no API to determine who did
 the LOAD for a loaded module.
 
 Do you also want to know who did a CALL or LINK?
 
 --
  Shmuel (Seymour J.) Metz, SysProg and JOAT
  Atid/2http://patriot.net/~shmuel
 We don't care. We don't have to care, we're Congress.
 (S877: The Shut up and Eat Your spam act of 2003)
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions, send
 email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: Who loaded me?

2012-12-05 Thread Jeremy Nicoll - ls mainframes
Charles Mills charl...@mcn.org wrote:

Issue CSVQUERY
INADDR=ptr_to_any_addr_in_my_pgm,SEARCH=JPALPA,SEARCHMINOR=NO,OUTEPNM=eight_
char_fld_in_writable_storage

 (I know some of those parms are defaults; I'm just being extra clear.)
 Given RC=0, that gets me my name. Do I need anything else on CXVQUERY
 other than the usual MF= considerations? Am I safe ignoring PLISTVER and
 any other parameters?

Suppose someone's defined one or more aliases of the program concerned.  

Is there any combination of uses where the JCL could say EXEC PGM=PROGRAMx
but the CSVQUERY would return PROGRAMy - either when one or other of
PROGRAMx/y s the 'real' program, or when both PROGRAMx/y are aliases of
something else?


-- 
Jeremy C B Nicoll - my opinions are my own.

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


Re: Who loaded me?

2012-12-05 Thread Bill Fairchild
It's in the archives multiple times.  About once a year this same question is 
asked, followed by a flurry of technical replies, and finally a small flurry of 
it can't be done in the general case replies.

Not everything is in the archives.  And a lot is in the archives that doesn't 
need to be there, because of topic drift and periodic asking of the same 
question.

I once had a colleague who asked me at least once a day what time it was.  I 
told him the time of day every time he asked me for about two weeks.  Then one 
day I grew tired of the process and asked him politely, but not smugly, why he 
didn't have his own watch.

My answer of looking in the archives was too brief, and thus it appeared smug.  
I should have added that this was a difficult topic, there are a lot of details 
to consider, the problem is insoluble in the general case, and it is asked of 
IBM-MAIN about once a year.  Reviewing the archives will also reveal the 
details that have been brought out in the past but that might not have been 
brought out in the current round of replies to this annual topic.

Many of us do have answers right on the top of our head.  But it takes a fair 
amount of time to compose a technically correct and hopefully helpful reply.  
It has to be EXTREMELY correct because there are some posters who seem to 
thrive on finding fault with others' posts.  And I do not mean Charles Mills.  
I would hope that in an ideal world a would-be question-poser might contrast 
how much time it takes the five or six people who give thorough and correct 
answers with how much time he should research the subject himself before asking 
the whole world.  When I was a child eating dinner with my parents, I would 
often ask them what such-and-such a word meant after first hearing it in dinner 
conversation.  My dad, who had the answer on the top of his head,  would 
usually say you know how to spell now and how to find words that you don't 
know how to spell by breaking them down phonetically; look it up in the 
dictionary and/or encyclopedia (we had two different sets, one of which was 
Britannica) after dinner.  I would look it up and learn far more than just the 
meaning of that word.  My dad was not trying to be smug, but rather to instill 
in me more intellectual curiosity and individual resourcefulness.

OTOH, my advice to search the archives was, IMHO, much nicer than this answer:  
No.

Bill Fairchild
Programmer
Rocket Software
408 Chamberlain Park Lane * Franklin, TN 37069-2526 * USA
t: +1.617.614.4503 *  e: bfairch...@rocketsoftware.com * w: 
www.rocketsoftware.com


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Charles Mills
Sent: Wednesday, December 05, 2012 10:13 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Thanks, John.

It is so easy and facile to say RTFM.

Yeah, sure, it's in the archives. So is everything else.

When I lived in NYC in the sixties, I had a friend who had this idea of selling 
the police a list of everyone in Manhattan who smoked dope. It was the 
Manhattan phone book.

I have a program that will tell you anyone's RACF password. It's a random 
password generator. If you click it enough times it will generate the password 
you are looking for.

RTFM is an appropriate response in many cases, but it is vastly overused as a 
smug put-down. If a friend asked you what time it was, would you tell him there 
was a clock in a room down the hall, or would you look at your wrist and tell 
him the damned time?

I suspected someone would know the answer to my fairly simple question of the 
top of their heads, and I was right, Peter Relson did. If you don't have an 
easy answer off the top of your head, or you're too busy to respond, you are 
free to ignore a question. Put-downs are not necessary.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of John Gilmore
Sent: Wednesday, December 05, 2012 7:56 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Bill Fairchild is guilty of meiosis, the antonym of hyperbole.  There is very 
much too much discussion of this topic in the archives.

It is of course possible to get answers to carefully circumscribed special 
cases of this question of the sort Charles Mills is seeking.
There are no general/generic answers to it, and the prospects for one are bleak.

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

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Oh d***, you're absolutely right. Customer says EXEC PGM=alias but CSVQUERY
returns the major name. D***, d***, d***! That is absolutely a real-world
possibility even in my constrained set of cases.

The alias would be an alias for the main entry point so finding the nearest
minor name is not a solution. D***, d***, d***!

Back to the drawing board.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Jeremy Nicoll - ls mainframes
Sent: Wednesday, December 05, 2012 12:28 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Charles Mills charl...@mcn.org wrote:

Issue CSVQUERY
INADDR=ptr_to_any_addr_in_my_pgm,SEARCH=JPALPA,SEARCHMINOR=NO,OUTEPNM=e
ight_
char_fld_in_writable_storage

 (I know some of those parms are defaults; I'm just being extra clear.) 
 Given RC=0, that gets me my name. Do I need anything else on 
 CXVQUERY other than the usual MF= considerations? Am I safe ignoring 
 PLISTVER and any other parameters?

Suppose someone's defined one or more aliases of the program concerned.  

Is there any combination of uses where the JCL could say EXEC PGM=PROGRAMx
but the CSVQUERY would return PROGRAMy - either when one or other of
PROGRAMx/y s the 'real' program, or when both PROGRAMx/y are aliases of
something else?

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Thanks Bill, I understand what you are saying and I apologize if my reply
was too harsh. There is no absolute answer: neither saying RTFM nor
explaining basics to a newbie is the right answer in every case. Someone
asked here the other day so, how do I set up a WLM? Unquestionably the
right answer is read 'Init and Tuning' (?) and come back here with your
specific questions.

I'm not unwilling to read manuals. Someone said use CSVQUERY. Well, I've
never used CSVQUERY before, so I read the doc from top to bottom. (And,
sadly, looked futilely in the A/S Guide for a single example or usage
paragraph!)

Yeah, the people who nit-pick the helpful-but-lacking-one-obscure-detail
answers are winning the battle but losing the war: they discourage people
from answering a simple question for fear of being flamed for omitting one
complex detail.

Take care,
Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Bill Fairchild
Sent: Wednesday, December 05, 2012 12:52 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

It's in the archives multiple times.  About once a year this same question
is asked, followed by a flurry of technical replies, and finally a small
flurry of it can't be done in the general case replies.

Not everything is in the archives.  And a lot is in the archives that
doesn't need to be there, because of topic drift and periodic asking of the
same question.

I once had a colleague who asked me at least once a day what time it was.  I
told him the time of day every time he asked me for about two weeks.  Then
one day I grew tired of the process and asked him politely, but not smugly,
why he didn't have his own watch.

My answer of looking in the archives was too brief, and thus it appeared
smug.  I should have added that this was a difficult topic, there are a lot
of details to consider, the problem is insoluble in the general case, and it
is asked of IBM-MAIN about once a year.  Reviewing the archives will also
reveal the details that have been brought out in the past but that might not
have been brought out in the current round of replies to this annual topic.

Many of us do have answers right on the top of our head.  But it takes a
fair amount of time to compose a technically correct and hopefully helpful
reply.  It has to be EXTREMELY correct because there are some posters who
seem to thrive on finding fault with others' posts.  And I do not mean
Charles Mills.  I would hope that in an ideal world a would-be
question-poser might contrast how much time it takes the five or six people
who give thorough and correct answers with how much time he should research
the subject himself before asking the whole world.  When I was a child
eating dinner with my parents, I would often ask them what such-and-such a
word meant after first hearing it in dinner conversation.  My dad, who had
the answer on the top of his head,  would usually say you know how to spell
now and how to find words that you don't know how to spell by breaking them
down phonetically; look it up in the dictionary and/or encyclopedia (we had
two different sets, one of which was Britannica) after dinner.  I would
look it up and learn far more than just the meaning of that word.  My dad
was not trying to be smug, but rather to instill in me more intellectual
curiosity and individual resourcefulness.

OTOH, my advice to search the archives was, IMHO, much nicer than this
answer:  No.

Bill Fairchild
Programmer
Rocket Software
408 Chamberlain Park Lane * Franklin, TN 37069-2526 * USA
t: +1.617.614.4503 *  e: bfairch...@rocketsoftware.com * w:
www.rocketsoftware.com


-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Charles Mills
Sent: Wednesday, December 05, 2012 10:13 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Thanks, John.

It is so easy and facile to say RTFM.

Yeah, sure, it's in the archives. So is everything else.

When I lived in NYC in the sixties, I had a friend who had this idea of
selling the police a list of everyone in Manhattan who smoked dope. It was
the Manhattan phone book.

I have a program that will tell you anyone's RACF password. It's a random
password generator. If you click it enough times it will generate the
password you are looking for.

RTFM is an appropriate response in many cases, but it is vastly overused as
a smug put-down. If a friend asked you what time it was, would you tell him
there was a clock in a room down the hall, or would you look at your wrist
and tell him the damned time?

I suspected someone would know the answer to my fairly simple question of
the top of their heads, and I was right, Peter Relson did. If you don't have
an easy answer off the top of your head, or you're too busy to respond, you
are free to ignore a question. Put-downs are not necessary.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN

Re: Who loaded me?

2012-12-05 Thread Charles Mills
Suppose I modify the logic as follows. Does anyone see a problem with this?

Issue CSVQUERY OUTMJNM=name to determine the major name associated with some
address in me. (Any old address.)

Get the jobstep program name from the JSCB. Issue CSVQUERY
INEPNAME=jscbpgnm,SEARCHMINOR=YES,OUTMJNM=eight_char_field to get the major
name associated with the possibly minor name from PGM=.

Compare the two. Equality means I am the jobstep program. (Neglecting the
two programs/two libraries/one name case.)

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Charles Mills
Sent: Wednesday, December 05, 2012 1:17 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Oh d***, you're absolutely right. Customer says EXEC PGM=alias but CSVQUERY
returns the major name. D***, d***, d***! That is absolutely a real-world
possibility even in my constrained set of cases.

The alias would be an alias for the main entry point so finding the nearest
minor name is not a solution. D***, d***, d***!

Back to the drawing board.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Jeremy Nicoll - ls mainframes
Sent: Wednesday, December 05, 2012 12:28 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Charles Mills charl...@mcn.org wrote:

Issue CSVQUERY
INADDR=ptr_to_any_addr_in_my_pgm,SEARCH=JPALPA,SEARCHMINOR=NO,OUTEPNM=e
ight_
char_fld_in_writable_storage

 (I know some of those parms are defaults; I'm just being extra clear.) 
 Given RC=0, that gets me my name. Do I need anything else on 
 CXVQUERY other than the usual MF= considerations? Am I safe ignoring 
 PLISTVER and any other parameters?

Suppose someone's defined one or more aliases of the program concerned.  

Is there any combination of uses where the JCL could say EXEC PGM=PROGRAMx
but the CSVQUERY would return PROGRAMy - either when one or other of
PROGRAMx/y s the 'real' program, or when both PROGRAMx/y are aliases of
something else?

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

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


Re: Who loaded me?

2012-12-05 Thread Charles Mills
Okay! It's all working.

The C++ program that needs to make this determination does the following:

- Calls a C++ method to get the PGM= name from the JSCB and stores it in
char pgmEqualName[9];
- Calls an assembler subroutine that issues CXVQUERY
INEPNAME=(R2),SEARCH=JPALPA,OUTMJNM=(R6) where R2 points to pgmEqualName and
R6 points to char jobstepMajorName[9].
- Calls an assembler subroutine that issues CSVQUERY
INADDR=(R2),SEARCH=JPALPA,OUTMJNM=(R6) where R2 is the address of a constant
in the C++ code and R6 is char ourMajorName[9];
- Compares ourMajorName to jobstepMajorName and if they are equal concludes
that we are the jobstep program.

I have tested it both with

- Executing the C program directly but using an alias. The C++ program
correctly concludes that it is the jobstep program.
- Using a Rexx front-end to LINKMVS to the C++ program. The C++ program
reports that the PGM= name is IRXJCL, that its real major name is IRXINIT,
and that it ain't us.

QED

Thanks all for your help, especially Peter who pointed me at JSCBPGNM,
Gerhard who suggested CSVQUERY, and Jeremy who pointed out that I was headed
down a primrose path that would have failed with EXEC PGM=alias.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of Charles Mills
Sent: Wednesday, December 05, 2012 1:41 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Suppose I modify the logic as follows. Does anyone see a problem with this?

Issue CSVQUERY OUTMJNM=name to determine the major name associated with some
address in me. (Any old address.)

Get the jobstep program name from the JSCB. Issue CSVQUERY
INEPNAME=jscbpgnm,SEARCHMINOR=YES,OUTMJNM=eight_char_field to get the major
name associated with the possibly minor name from PGM=.

Compare the two. Equality means I am the jobstep program. (Neglecting the
two programs/two libraries/one name case.)

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


Re: Who loaded me?

2012-12-05 Thread Gerhard Postpischil

On 12/5/2012 4:16 PM, Charles Mills wrote:

The alias would be an alias for the main entry point so finding the nearest
minor name is not a solution. D***, d***, d***!


Since this appears to be your own program, consider putting an id (and 
date/time) at the entry, allowing a simple check regardless of how many 
entries or aliases the program has. And if it's really critical, 
generate a checksum over the program, provided it's refreshable.


Gerhard Postpischil
Bradford, Vermont

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


Re: Who loaded me?

2012-12-05 Thread Gerhard Postpischil

On 12/5/2012 10:10 AM, Shmuel Metz (Seymour J.) wrote:

The PGM= entry is the jobstep program, unless you're processing a TSO
command (but you specified batch...).


Even under TSO, PGM=IKJEFT01 is in a J/S task.


True, but irrelevant. A user program locating its JSTCB isn't going to 
see the system tasks unless it chases beyond its own JSTCB, which was 
not required to satisfy the original post.



Gerhard Postpischil
Bradford, Vermont

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


Who loaded me?

2012-12-04 Thread Charles Mills
I can look up any one thing in the manuals, but I'm trying to figure out
what would be the BEST way to do something that is not explicitly
documented.

1. What would be the best way for a program running z/OS batch to answer the
question Am I the jobstep program, the PGM= program, or was I LOADed and
CALLed or ATTACHed (let's ignore XCTL for now) by another program?
2. In addition, if the answer to (1.) is another program, where would I
find its entry point name? In other words, who loaded me? 

Yes, there are some complicating possibilities such as a program between the
jobstep program and me, but let's ignore that for now.

Thanks,
Charles 

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


Re: Who loaded me?

2012-12-04 Thread Charles Mills
Crap! And here I thought I had an answer to my question already.

g

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of zMan
Sent: Tuesday, December 04, 2012 2:23 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Who loaded me?

Much better Subject: than, How did I wind up loaded? :-)
--
zMan -- I've got a mainframe and I'm not afraid to use it

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

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


Re: Who loaded me?

2012-12-04 Thread Gerhard Postpischil

On 12/4/2012 5:19 PM, Charles Mills wrote:

1. What would be the best way for a program running z/OS batch to answer the
question Am I the jobstep program, the PGM= program, or was I LOADed and
CALLed or ATTACHed (let's ignore XCTL for now) by another program?
2. In addition, if the answer to (1.) is another program, where would I
find its entry point name? In other words, who loaded me?


It's probably not documented because there is no easy answer.

The PGM= entry is the jobstep program, unless you're processing a TSO 
command (but you specified batch...).


Get the current TCB, run the RB chain to find the oldest PRB. That 
corresponds to the program on an ATTACH(X) (note that the RB does not 
have the name, only addresses; you can match the extent list address 
against the load list, or use CSVQUERY). If the TCB is also a jobstep 
TCB, you have the PGM= or command processor, or a module XCTLed to. In 
case of XCTL, the original PGM= name is in the SCT.


If the current PRB is not the oldest, the previous RB PSW will have the 
interrupt code, allowing you to tell which SVC (LINK or SYNCH) invoked 
you. And that RB should allow you to determine the invoker.


For LOAD, the situation is messier. There is no extra PRB, and your best 
bet for a well-behaved program is to chase the save area chain, and test 
each entry point with the CSVQUERY service/macro.


This is very simplified. For authorized programs it gets messier (e.g., 
start tasks have two job step TCBs; batch programs three; and TSO more).



Gerhard Postpischil
Bradford, Vermont

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