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

Get Library of actual running Pgm.

397 views
Skip to first unread message

goe...@my-deja.com

unread,
Jan 25, 2001, 6:46:37 AM1/25/01
to
Hi!

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/

Simon B.

unread,
Jan 25, 2001, 9:25:03 AM1/25/01
to
In article <94p3ms$5p4$1...@nnrp1.deja.com>,
goe...@my-deja.com wrote:

> 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

Terrence Enger

unread,
Jan 25, 2001, 10:22:08 PM1/25/01
to
Quite of the PRDLIB() attribute of a command can relieve the program of
the need to do this.

HTH

Krzysztof Kulpiński

unread,
Jan 30, 2001, 11:48:07 AM1/30/01
to
You can also simplify tasks a bit creating for instance sort of "set-up"
e.g. some dataarea in library where the program is run. You can just put
name directly in this dataarea and read it in you program.
May be not that inteligent program itself but easier to handle. You can
change the lib in dtaara instead of recompiling program in case
environment changes.

Best regards
Q.

Erik Zaat

unread,
Feb 2, 2001, 5:58:27 PM2/2/01
to
I'v solved the problem on this way:

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...

0 new messages