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:[email protected]] On Behalf Of Peter Relson Sent: Wednesday, December 05, 2012 4:36 AM To: [email protected] 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 [email protected] with the message: INFO IBM-MAIN
