Sure.  You have at least two CATAA EXEC files in your search.  The LISTFILE
on line 9 returns at least two stacked items which start CATAA ...  

 

You PULL the first off of the stack on Line 11, and then EXIT on line 15.
EVERYTHING else that was on the stack now gets dumped out to CMS.  

 

What happens when you type CATAA on the CMS command line and press ENTER?
Correct - it executes your exec.  :)

 

There are much better ways to get data in/out of a REXX program than the
very ancient old STACK.  May I suggest using a PIPE:

 

'PIPE COMMAND LISTFILE CATAA EXEC X (DATE | STEM RESULT.'

 

If Result.0=0 Then Say Result.1  /*This will yield "File not found" or
something to that effect.

Else Do I=1 To Result.0  /*Loop through each result and do something..*/

   Say 'Result.'I'='Result.I

End

 

Exit Rc /*Exit on LISTFILE's RC*/

 

Or you could use brute force and put a 'DESBUF' between line 14 and 15 (but
that will destroy ALL buffers, if you MUST use the stack look into the
equally ancient MAKEBUF/DROPBUF commands).

 

-Mike

 

From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On
Behalf Of Sergio Lima
Sent: Thursday, October 14, 2010 3:19 PM
To: IBMVM@LISTSERV.UARK.EDU
Subject: REXX that verify what MINIDISK is a file

 

Hello List,
 
We are changing a REXX here for that this EXEC execute only if reside on X
acessed minidisk.
So, try with STATE command without succesfull  and now try  with LISTFILE
command.
If execute like this :
 
     9 *-* 'LISTFILE  cataa exec x (DATE STACK LIFO'                   
       >>>   "LISTFILE  cataa exec x (DATE STACK LIFO"                 
    10 *-* if rc = 0                                                   
       >>>   "1"                                                       
       *-*  then                                                       
       *-*  do                                                         
    11 *-*   pull x1 x2 x3 .                                           
       >>>     "CATAA"                                                 
       >>>     "EXEC"                                                  
       >>>     "X2"                                                    
       >.>     "V         83        506          4 10/14/10 15:03:32"  
    12 *-*   say x1                                                    
       >>>     "CATAA"                                                 
CATAA                                                                  
    13 *-*   say x2                                                    
       >>>     "EXEC"                                                  
EXEC                                                                   
    14 *-*   say x3                                                    
       >>>     "X2"                                                    
X2                                                                     
    15 *-*   exit                                                      
 
But, when try execute with filemode *, lookslike the program go to a LOOPING
:
 
     9 *-* 'LISTFILE  cataa exec * (DATE STACK LIFO'                   
       >>>   "LISTFILE  cataa exec * (DATE STACK LIFO"                 
    10 *-* if rc = 0                                                   
       >>>   "1"                                                       
       *-*  then                                                       
       *-*  do                                                         
    11 *-*   pull x1 x2 x3 .                                           
       >>>     "CATAA"                                                 
       >>>     "EXEC"                                                  
       >>>     "X2"                                                    
       >.>     "V         83        506          4 10/14/10 15:03:32"  
    12 *-*   say x1                                                    
       >>>     "CATAA"                                                 
CATAA                                                                  
    13 *-*   say x2                                                    
       >>>     "EXEC"                                                  
EXEC                                                                   
    14 *-*   say x3                                                    
       >>>     "X2"                                                    
X2                                                                     
    15 *-*   exit                                                      
     9 *-* 'LISTFILE  cataa exec * (DATE STACK LIFO'                   
       >>>   "LISTFILE  cataa exec * (DATE STACK LIFO"                 
    10 *-* if rc = 0                                                   
       >>>   "1"                                                       
       *-*  then                                                       
       *-*  do                                                         
    11 *-*   pull x1 x2 x3 .                                           
       >>>     "CATAA"                                                 
       >>>     "EXEC"                                                  
                                                                       
The command in the line show this :
 
listfile cataa exec *        
CATAA    EXEC     A2         
CATAA    EXEC     X2         
Ready; T=0.01/0.01 16:17:00  
 
Someone can help, how can verify if this EXEC is not running from X disk ?
 
Thanks very much,
 
Sergio Lima Costa
Sao Paulo - Brazil

Reply via email to