Return to the CL Tips
A way to get a CL program name and library without using an API (from Petre)
============================================================ Dcl Var(&Sender) Type(*CHAR) LEN(80) Dcl Var(&ClPgmName) Type(*CHAR) LEN(10) Dcl Var(&ClPgmMsgQ) Type(*CHAR) LEN(10) Dcl Var(&ClPgmLib) Type(*CHAR) LEN(10) Dcl Var(&MyCL) Type(*CHAR) LEN(22) /* Get program name, library, and program message queue */ DltF File(@#$$$@##@$) /* Dummy File */ RcvMsg Sender(&Sender) ChgVar Var(&ClPgmName) Value(%sst(&Sender 56 10)) ChgVar Var(&ClPgmMsgQ) Value(&ClPgmName) RtvObjD Obj(&ClPgmName) ObjType(*PGM) RtnLib(&ClPgmLib) ChgVar Var(&MyCL) Value(&ClPgmName *TCAT '(' *TCAT + &ClPgmLib *TCAT ')') ============================================================= Petre
[report a broken link by clicking here]