Explicitly execute as CLIST from REXX exec



IBM's Command List programming language & Restructured Extended Executor

Explicitly execute as CLIST from REXX exec

Postby Steve Coalbran » Wed Jan 13, 2016 10:34 pm

I appologise in advance if this question is 'fuzzy' but I am not sure exactly in which area this falls, TSO or REXX.
I should probably know this by now but I can't remember having to know this before!...

Inside a REXX exec, how do I execute an external function IMplicitly as a CLIST?
ie.
in REXX (DRIVER)
/*REXX*/ TRACE "C"
ADDRESS TSO 
parms = "doe ray me so far lah tea doe" /* 'Sound of music' version! */
parms = TRANSLATE(parms,'_',' ')  /* has to be one string, no blanks */
/* I can do the EXPLICIT execution                                   */
"EX 'N472730.USER.EXEC(WRT)' 'W("parms")' CLIST " 
/* BUT I want to do the IMPLICIT execution, which of course fails    */
"%WRT 'W("parms")' CLIST "
/*                 ¯¯¯¯¯ unavailable on %invocation                  */
/* without the CLIST parm one gets a REXX error, even omitting W()   */
"%WRT"                                                                 
EXIT

and in CLIST (WRT)
PROC 0 W(77) 
CONTROL MAIN LIST MSG 
WRITE &W 
EXIT 

The last two REXX attempts both result in...
IRX0043I Error running WRT, line 1: Routine not found
WRT could be in SYSPROC or SYSEXEC, or worse, both, and different content in each.
I need to know the setting of the SEARCHDD to find out which in order to search the allocations If I need to specify the dataset name explicitly.
I see no way to trap this from HELP.
OR... am I missing something?...
Is there a way that I can IMplicitly call it as a CLIST?
(I tried /*CLIST*/ at the head of WRT! No way, no such luck (would've been nice Mike?)
/Steve
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: Explicitly execute as CLIST from REXX exec

Postby Steve Coalbran » Wed Jan 13, 2016 11:10 pm

The title could equally well be...
IMplicitly execute as CLIST from REXX exec
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: Explicitly execute as CLIST from REXX exec

Postby Mickeydusaor » Thu Jan 14, 2016 1:06 am

/*REXX*/
TRACE ?R
ADDRESS TSO

PARMS = "DOE RAY ME SO FAR LAH TEA DOE" /* 'SOUND OF MUSIC' VERSION! */
PARMS = TRANSLATE(PARMS,'_',' ') /* HAS TO BE ONE STRING, NO BLANKS */

"%WRT W("PARMS")"

"%WRT"
EXIT
User avatar
Mickeydusaor
 
Posts: 29
Joined: Fri Feb 24, 2012 11:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Explicitly execute as CLIST from REXX exec

Postby NicC » Thu Jan 14, 2016 2:22 am

Why not use the pools as you did with SAYNR/WRINR?
PARSE ARG saynrm                                                               
   saynra = 0                                                                   
   ADDRESS ISPEXEC "VPUT (SAYNRM) SHARED "                                     
   ADDRESS TSO "%WRINR"                                                         
   ADDRESS ISPEXEC "VGET (SAYNRA) SHARED "                                     
RETURN saynra
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Explicitly execute as CLIST from REXX exec

Postby Pedro » Thu Jan 14, 2016 2:26 am

This worked for me with both members in SYSPROC.
/* rexx */   
Address TSO 
"%wrt"       


PROC 0 W(77)         
CONTROL MAIN LIST MSG
WRITE &W             
EXIT                 


We have VB255 sysproc datasets, so I tried the WRT both as numbered starting in column 9 or as unnumbered starting in column 1. Both worked.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Explicitly execute as CLIST from REXX exec

Postby Steve Coalbran » Thu Jan 14, 2016 11:10 am

Mickeydusaor wrote:"%WRT W("PARMS")"

for me gives..
     4 *-* PARMS = "DOE RAY ME SO FAR LAH TEA DOE" /* 'SOUND OF MUSIC' VERSION!
 */                                                                           
       >>>   "DOE RAY ME SO FAR LAH TEA DOE"                                   
                                                                               
     5 *-* PARMS = TRANSLATE(PARMS,'_',' ') /* HAS TO BE ONE STRING, NO BLANKS
*/                                                                             
       >>>   "DOE_RAY_ME_SO_FAR_LAH_TEA_DOE"                                   
                                                                               
     6 *-* "%WRT W("PARMS")"                                                   
       >>>   "%WRT W(DOE_RAY_ME_SO_FAR_LAH_TEA_DOE)"                           
     1 +++ PROC 0 W(77)                                                       
IRX0043I Error running WRT, line 1: Routine not found                         
       +++ RC(20043) +++

BUT both the driver and WRT are in SYSEXEC - esta el problèma?
I will try moving it
...[PAUSE]...
That works fine! Derrrr!?

Thanks to all!
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: Explicitly execute as CLIST from REXX exec

Postby Steve Coalbran » Thu Jan 14, 2016 11:15 am

NicC wrote:Why not use the pools as you did with SAYNR/WRINR?

Hi Nic,
Yes, this is a version of SAYNR+WRINR I am working on.
I could VPUT & VGET (to save the pseudo-space-char translation) but that involves running under ISPF?
This is an attempt at a LITE version.

PS: goood that you took a moment out from the pizzas! Still working on a visit, financial constraints (y'know?!) :cry:

NOTE: I also tried using PUSH/QUEUE and a READ, thinking (naiavely that &READVAL might get the parm in WRT but, clearly different queues? :(
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: Explicitly execute as CLIST from REXX exec

Postby Steve Coalbran » Thu Jan 14, 2016 11:47 am

Pedro wrote:This worked for me with both members in SYSPROC

Thanks Pedro - I had both in SYSEXEC and SYSPROC (same library).
I can foresee a problem of usability here though, If this is a generalized function then I cannot predict how people have their libraries organized as they have the facility to tailor their SYSPROC/SYSEXEC allocations.
To EXplicitly invoke WRT I could:
  • Trap the allocations
  • Check each SYSPROC and SYSEXEC library
  • Perform a SYSDSN('library(WRT)') for each
  • Stop at OK
  • Issue: "EX 'library(WRT)' 'W("parms")' CLIST "
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: Explicitly execute as CLIST from REXX exec

Postby Pedro » Wed Feb 03, 2016 10:06 pm

I just remembered...

WRT is a CLIST. A CLIST should not reside in SYSEXEC. That is, you cannot call it by Address TSO "%WRT"; the system will go through the normal search order and if it is found in SYSEXEC, it will be explicitly called as an exec.
Pedro Vera

These users thanked the author Pedro for the post:
Steve Coalbran (Fri Mar 11, 2016 1:33 pm)
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post