Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what cl is executing from a cl

2 views
Skip to first unread message

Xisco

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
How, I can know what cl is executing from a cl program (for example RTVJOBA)

Example: forn know a user from a cl program , I use
DCL VAR(&MIUSER) TYPE(*CHAR) LEN(10)
RTVJOBA USER(&MIUSER)

and for Know a name of cl program???
DCL VAR(&clname1) TYPE(*char) LEN(10)
RTV???? ????


THANKS

P.D. (My english is very poor)


B.P.

unread,
Jul 6, 2000, 3:00:00 AM7/6/00
to
Send and receive a message:

DCL VAR(&SENDER) TYPE(*CHAR) LEN(80)
DCL VAR(&CLNAME1) TYPE(*CHAR) LEN(10)
SNDPGMMSG MSG('WHO AM I?') TOPGMQ(*SAME (*))
RCVMSG MSGTYPE(*LAST) SENDER(&SENDER) SENDERFMT(*SHORT)
CHGVAR VAR(&CLNAME1) VALUE(%SST(&SENDER 56 10))

The help text for the SENDERFMT parameter describes the format of the SENDER
variable.

Xisco <xisc...@teleline.es> wrote in message
news:8k2bk7$9e0$1...@talia.mad.ttd.net...

Simon Brunning

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
Xisco wrote in message <8k2bk7$9e0$1...@talia.mad.ttd.net>...

>and for Know a name of cl program???
>DCL VAR(&clname1) TYPE(*char) LEN(10)
>RTV???? ????

If you only need to know the *name* of the current CL program, you
can do:

SNDPGMMSG MSG('Ping') TOPGMQ(*SAME *)
RCVMSGvMSGTYPE(*LAST) SENDER(&SENDER)
CHGVAR &CLNAME1 %SST(&SENDER 56 10)

If you also need to know the name if the library that it's in, you
need the rather unpleasant:

/* Retrieve program name & library
*/
OVRDBF FILE(QPPGMDMP) TOFILE(QTEMP/NOSUCHFILE)
OVRSCOPE(*JOB)
DMPCLPGM
MONMSG MSGID(CPF0570) EXEC(DO)
RCVMSG MSGTYPE(*DIAG)
RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA)
CHGVAR VAR(&PGM) VALUE(%SST(&MSGDTA 1 10))
CHGVAR VAR(&PGMLIB) VALUE(%SST(&MSGDTA 11 10))
ENDDO
DLTOVR FILE(QPPGMDMP) LVL(*JOB)

Cheers,
Simon Brunning
TriSystems Ltd.
sbru...@trisystems.co.uk
The opinions expressed are mine, and are not necessarily those of my
employer. All comments provided "as is" with no warranties of any
kind whatsoever.

Simon Brunning

unread,
Jul 7, 2000, 3:00:00 AM7/7/00
to
0 new messages