View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Wed Dec 20, 2023 6:08 am Post subject: Address LINK gives rc -3 |
|
|
It's not so much the -3 return code that's "bothering" me (and it's given because the actual program hasn't been added to the STEPLIB path), but I would like to be able to capture the return code without the following being shown on the screen.
Code: |
check_steplib_allocated:
/* say 'In check_steplib_allocated in 'rname ; trace ?a */
SteplibAddedRc = 0 /* Default is it WAS allocated */
X = MSG('OFF')
Address LINK 'CSLULXSB'
if rc <> 0 then
do
ADDRESS TSO "STEPLIB ADD DA('xxxx.xxxx.xxxx.xxxx.RESLIB') LAST"
Address LINK 'CSLULXSB'
SteplibAddedRc = -3 /* Indicate it WASN'T allocated. */
end
X = MSG('ON') /* Reset */
return SteplibAddedRc
|
and when I run it from the command line via TSO myrexxname I see the following
Quote: |
Using TEST.SPOC(LBBK)
Current PLEX name PLEXB
170 *-* Address LINK 'CSLULXSB'
+++ RC(-3) +++
MSSPOC next cmd /STA TRAN LBBK
MSSPOC next cmd /STA TRAN LBBK TFYKP0
MSSPOC next cmd /STA PGM TFYKP0
|
What's the best way of avoiding this -3 being shown on the screen. Checking whether the RESLIB is allocated or similar ??? _________________ Michael |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 20, 2023 9:43 am Post subject: |
|
|
misi01,
You can use TSOLIB which provides for an additional search level that TSO/E uses when searching for commands and programs. With TSOLIB, you specify load module libraries containing executable commands and programs, which are put to the top of the standard search order.
Look at the Example 5: Activate an allocated file from within a REXX Exec
https://www.ibm.com/docs/en/zos/3.1.0?topic=command-tsolib-examples _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Thu Dec 21, 2023 5:18 am Post subject: |
|
|
Thank you. In the end I went for the solution of running the LISTALC command and then looping through the results to see if the loadlib was already allocated.
(I tried appending the Rexx code via the open/close CODE tags, but it kept on blanking out my entry. Could you test and see if it's the same for you?) _________________ Michael |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Dec 21, 2023 11:25 am Post subject: |
|
|
misi01 wrote: | (I tried appending the Rexx code via the open/close CODE tags, but it kept on blanking out my entry. Could you test and see if it's the same for you?) |
Misi01,
the preview seem to be broken but the code block does work
Code: |
/* rexx */
"ALLOCATE FILE(MYLOAD) DATASET('JIM.LOAD') SHR"
if RC = 0 then
push "TSOLIB ACTIVATE FILE(MYLOAD)"
exit
⋮
? back in TSO/E READY environment, start the REXX exec
⋮
? invoke commands and programs from TSOLIB data set.
⋮ |
will work on fixing it sometime during holidays _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|