Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling a CLIST from a REXX

Status
Not open for further replies.

Wimver

IS-IT--Management
Apr 25, 2012
2
US
When issuing Commands and Subcommands from REXX, I run into a problem, in that subcommands are never executed. I can do it with CLIST, so I generate a CLIST from REXX and execute the CLIST. The problem is I always get a 0 return code back from the CLIST... Any ideas.

Here is a simplified version of the code

/************************** REXX *****************/
"DEL TMP.CLIST"
"ALLOC DA(TMP.CLIST) NEW SPACE(1,1) RECFM(F,B) LRECL(80),
BLKSIZE(27920) FI(OUTFILE)"
SAY 'GIVE ME AN ID'
PULL ID
QUEUE "ACF"
QUEUE "T TE"
QUEUE "L " ID
QUEUE "Q"
N1 = QUEUED()
"EXECIO" N1 "DISKW OUTFILE (FINIS"
"FREE FI(OUTFILE)"
EX TMP.CLIST
IF RC \= 0 THEN
SAY ID " NOT FOUND"
ELSE
SAY ID " FOUND"

In this example, &MAXCC after the Q is 4 when not found, but RC is always 0
 
Sorry folks. I found my answer..

I needed to code and EXIT CODE(&MAXCC) at the end of the CLIST

 
Instead of writing a CLIST and executing that, why not just

QUEUE "T TE"
QUEUE "L " ID
QUEUE "Q"
"ACF"

That is: you put on the queue all the commands you want ACF2 to execute, then invoke ACF2. ACF2 will pick up the active queue and process each command in turn. Works like a charm. I've used this method for centuries (well... decades, anyway).


Frank Clarke
--America's source for adverse opinions since 1943.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top