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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interrogate command line comming back from edit within REXX

Status
Not open for further replies.

mikerexx

MIS
Aug 4, 2009
23
US
I have the following:

/* REXX */

ARG OUTP

STAT = MSG('OFF')
UID = SYSVAR(SYSUID)

ADDRESS ISPEXEC
"EDIT DATASET('TEST.MYDSN')"

ADDRESS TSO

"FREE FILE(MYDD)"
"ALLOC FILE(MYDD) ",
"DATASET('TEST.MYDSN') SHR"
...

I want to interrogate the COMMAND LINE upon returning from the edit session of 'TEST.MYDSN'. For example:

ADDRESS ISPEXEC
"EDIT DATASET('TEST.MYDSN')"

if COMMAND = 'QUIT' then exit

Im sure that "COMMAND" above is not available or correct. Does anyone know how to do this?
 
The field name is most likely "ZCMD", but I don't think it's necessarily populated for PFKeys. If the user types "quit" on the command line, it will come back to you only if you take some special action such as terminating the edit session when zcmd='quit'.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Thanks for the quick reply.

So when in the edit session i typed 'CAN'. This obviously terminate the edit session. But ZCMD does not have anything in it. What do you mean by
"The field name is most likely "ZCMD""?
 
You can interrogate the return code from edit but I am not sure if it differentiates between "cancel" and "end".

If you do not know what zcmd is then you really need to read the ISPF manuals. ISPF has a load of variables all beginning with Z. ZCMD will hold the contents of the command line but whether it still holds the value after termination of the edit I do not know.
 
Try checking the return code instead. Can't remember what they are off the top of my head, but 0, 4, and 8 are the likely candidates...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top