I want to give an CL-Program the "intelligence" to realize
in which Library it is running. Got this information the CL
Programm should then do an ADDLIBLE to this library.
Is there a command to get the actual Library (means not current
library, which is to get with RTVJOBA)?
Andi Goering
Sent via Deja.com
http://www.deja.com/
> I want to give an CL-Program the "intelligence" to realize
> in which Library it is running. Got this information the CL
> Programm should then do an ADDLIBLE to this library.
>
> Is there a command to get the actual Library (means not current
> library, which is to get with RTVJOBA)?
WARNING - GRUESOME CODE ALERT!
/* 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)
Not pretty, but it works. Much like myself, really. I wouldn't usually
advocate nasty hacks like this, but I couldn't find any other way of
doing it.
Unless you are will to shell out for a better way, that is, in which
case check out the 'Programs in use' tool from
<http://www.precosis.com.au>.
--
Simon Brunning
If knowledge can create problems, it is not through ignorance that we
can solve them. - Isaac Asimov
HTH
Best regards
Q.
The problem is, that you wanted do an ADDLIBLE.
In a CLP program you can't get the libraryname.
In a CMD prompt you have to type in the actual library name as a current or
production library.
Instead of calling the CLP programming i did the following:
I created a RPG program. I use the System Data Structure to retrieve the
libraryname
of the actual library name (you even get the actual programm name,job number
ect.)
I do a ADDLIBLE in RPG with QCMD, call the CL program, and do an RMVLIBLE.
<goe...@my-deja.com> schreef in bericht news:94p3ms$5p4$1...@nnrp1.deja.com...