Address LINK gives rc -3
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: Address LINK gives rc -3 Author: misi01Location: Stockholm, Sweden PostPosted: Wed Dec 20, 2023 6:08 am
    —
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 ???

#2:  Author: kolusuLocation: San Jose PostPosted: Wed Dec 20, 2023 9:43 am
    —
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

#3:  Author: misi01Location: Stockholm, Sweden PostPosted: Thu Dec 21, 2023 5:18 am
    —
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?)

#4:  Author: kolusuLocation: San Jose PostPosted: Thu Dec 21, 2023 11:25 am
    —
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



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group