50 pts.
 Inside a running CL program can you find the lib that the program is running from?
Can you find in a running CL program the lib that it was started from? For example in a C program you can get the library name from argv[0].

Software/Hardware used:
ASKED: February 17, 2009  2:46 PM
UPDATED: February 18, 2009  2:51 PM

Answer Wiki:
Look at the QUSRJOBI api. I think that format JOBI0700 has what you are looking for. _______________________________________________________________ Do you really want 'started from'? More typical would be the library the program is currently running from (which 99.999% of the time is the same). If you're interested in running from then the following code will do that: <pre> Pgm Dcl Var(&PgmInfo) Type(*Char) Len(80) Dcl Var(&BytPrv) Type(*Int) Stg(*Defined) + DefVar(&PgmInfo) Dcl Var(&BytAvl) Type(*Int) Stg(*Defined) + DefVar(&PgmInfo 5) Dcl Var(&Format) Type(*Int) Stg(*Defined) + DefVar(&PgmInfo 9) Dcl Var(&Rsv) Type(*Char) Stg(*Defined) Len(4) + DefVar(&PgmInfo 13) Dcl Var(&Lib) Type(*Char) Stg(*Defined) Len(30) + DefVar(&PgmInfo 19) Dcl Var(&Library) Type(*Char) Len(10) ChgVar Var(&BytPrv) Value(80) ChgVar Var(&Format) Value(0) ChgVar Var(&Rsv) Value(x'00000000') CallPrc Prc('_MATPGMNM') Parm((&PgmInfo)) ChgVar Var(&Library) Value(&Lib) SndUsrMsg Msg(&Library) MsgType(*Info) EndPgm </pre> Bruce <a href="http://www.brucevining.com/">Bruce Vining Services</a>
Last Wiki Answer Submitted:  February 18, 2009  2:51 pm  by  Teandy   5,830 pts.
All Answer Wiki Contributors:  Teandy   5,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _