MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Address LINK gives rc -3

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Wed Dec 20, 2023 6:08 am    Post subject: Address LINK gives rc -3 Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Dec 20, 2023 9:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Thu Dec 21, 2023 5:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Dec 21, 2023 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group