Sergio,

It's not clear to me why you are issuing the "LISTFILE" in the first place. Is that a necessary function of your (now named) VX EXEC, or is it left over from your initial attempt to determine which disk your EXEC was running from?

If stacking the output of the "LISTFILE" is a necessary function of your EXEC, it really should be invoked _after_ you have verified that you are executing the right version of your EXEC in the first place. That would also make the "DESBUF" unnecessary when you find out you aren't.

If the Rexx program you are running is "VX EXEC", and the "LISTFILE" is left over from your initial attempt to discover which disk it is being executed from, then you should remove the "LISTFILE" and "DESBUF" commands. They are no longer necessary. The Rexx "Parse Source" command is all you need.

Here is how I would have done it, using a slightly more sophisticated Parse template to avoid the Left() built-in function:

/* VX EXEC - Do something necessary and useful */
  Trace Results
  Parse Source . 'EXEC' fm +1 .
  If fm = 'X' Then Call NandUcode
    Say "You are not executing from the 'X' disk!"
    Exit 99
  NandUcode: /* Do something necessary and useful */

-Chip-

On 10/15/10 19:19 Sergio Lima said:
Hello Jim,
Run well look please: 3 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 5 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "VX" >>> "EXEC" >>> "A1" >.> "VX CMS" 6 *-* If left(x3,1) <> 'X' >>> "1" *-* Then *-* Do 7 *-* Say 'You are not executing from the X disk!' >>> "You are not executing from the X disk!" You are not executing from the X disk! 8 *-* "Desbuf" >>> "Desbuf" 9 *-* Exit 99 >>> "99" Thanks very much, Jim.
Best Regards,
Sergio ------------------------------------------------------------------------
Date: Thu, 14 Oct 2010 17:33:36 -0400
From: jim.hug...@doit.nh.gov
Subject: Re: REXX that verify what MINIDISK is a file
To: IBMVM@LISTSERV.UARK.EDU

You need to issue a DESBUF command before the EXIT 99 statement.

The LISTFILE command is putting the EXECNAME is the program/console stack and being read after your problem exits. CMS reads it and starts executing it again and again,,,,,

____________________

Jim Hughes

603-271-5586

"It is fun to do the impossible."

------------------------------------------------------------------------

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

Scott,
Sorry about disturb, but still don't run, look please : The code : trace r 'LISTFILE cataa exec * (DATE STACK LIFO' Parse Source . . x1 x2 x3 . If left(x3,1) <> 'X' Then Do Say 'You are not executing from the X disk!' Exit 99 End The result : 3 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 5 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "VX" >>> "EXEC" >>> "A1" >.> "VX CMS" 6 *-* If left(x3,1) <> 'X' >>> "1" *-* Then *-* Do 7 *-* Say 'You are not executing from the X disk!' >>> "You are not executing from the X disk!" You are not executing from the X disk! 8 *-* Exit 99 >>> "99" 8 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 10 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "CATAA" >>> "EXEC" >>> "A2" >.> "CATAA CMS" 11 *-* If left(x3,1) <> 'X' >>> "1" *-* Then HOL *-* Do 12 *-* Say 'You are not executing from the X disk!' >>> "You are not executing from the X disk!" You are not executing from the X disk! 13 *-* Exit 99 >>> "99" 8 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 10 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "CATAA" >>> "EXEC" >>> "A2" >.> "CATAA CMS" 11 *-* If left(x3,1) <> 'X' >>> "1" *-* Then *-* Do 12 *-* Say 'You are not executing from the X disk!' >>> "You are not executing from the X disk!" You are not executing from the X disk! 13 *-* Exit 99 >>> "99" 8 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 10 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "CATAA" Loop again, Thanks, Sergio
------------------------------------------------------------------------

Date: Thu, 14 Oct 2010 14:48:09 -0600
From: scott.rohl...@gmail.com
Subject: Re: REXX that verify what MINIDISK is a file
To: IBMVM@LISTSERV.UARK.EDU

Yes - I corrected this in another post - you only want the first character of the filemode - or it will never be just X:

Parse Source . . x1 x2 x3 . If left(x3,1) <> 'X' Then Do Say 'You are not executing from the X disk!' Exit 99 End Note the 2nd line now has left(x3,1) to only look at the first character. This is because the filemode is actually X1 or X2, etc.

Scott Rohling

On Thu, Oct 14, 2010 at 2:22 PM, Sergio Lima <sergiovm...@hotmail.com <mailto:sergiovm...@hotmail.com>> wrote:

Hello,
Thanks from your help. This code : trace r 'LISTFILE cataa exec * (DATE STACK LIFO' Parse Source . . x1 x2 x3 . If x3 <> 'X' Then Do Say 'You are not executing from the X disk!' Exit 99 End

Also do a loop, look please : 8 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 10 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "CATAA" >>> "EXEC" >>> "A2" >.> "CATAA CMS" 11 *-* If x3 <> 'X' >>> "1" *-* Then *-* Do 12 *-* Say 'You are not executing from the X disk!'


>>> "You are not executing from the X disk!" You are not executing from the X disk! 13 *-* Exit 99 >>> "99" 8 *-* 'LISTFILE cataa exec * (DATE STACK LIFO' >>> "LISTFILE cataa exec * (DATE STACK LIFO" 10 *-* Parse Source . . x1 x2 x3 . >.> "CMS" >.> "COMMAND" >>> "CATAA" >>> "EXEC" >>> "A2" >.> "CATAA CMS" 11 *-* If x3 <> 'X' >>> "1" *-* Then Any mistake here ? Sergio
------------------------------------------------------------------------

Date: Thu, 14 Oct 2010 13:34:28 -0600
From: scott.rohl...@gmail.com <mailto:scott.rohl...@gmail.com>
Subject: Re: REXX that verify what MINIDISK is a file


To: IBMVM@LISTSERV.UARK.EDU <mailto:IBMVM@LISTSERV.UARK.EDU>

Parse Source . . x1 x2 x3 .
If x3 <> 'X' Then Do
  Say 'You are not executing from the X disk!'
  Exit 99
End

Scott Rohling

On Thu, Oct 14, 2010 at 1:19 PM, Sergio Lima <sergiovm...@hotmail.com <mailto:sergiovm...@hotmail.com>> wrote:

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