Question & Answer
Question
Client was looking for a method to determine if a locally written rexx program had been invoked by the NetView WINDOW (CNME1505) command, ie. "WINDOW MYREXX". The reason to need this information because certain local rexxes in their environment could not be invoked in a WINDOW environment and they wanted to prevent Operators from doing so.
Answer
The solution is the PIPE stage ENVDATA.
This document lists the URL to find its documentation, which can also be referenced on-line with NetView command 'HELP PIPE ENVDATA'.
For reference here is the output from PIPE ENVDATA|CONSOLE:
a) a rexx without window
WINTEST
SCREEN DEPTH 24
SCREEN WIDTH 80
COLOR COUNT 7
GENEALOGY WINTEST/WINTEST
b) a rexx called with window
WINDOW WINTEST
SCREEN DEPTH 24
SCREEN WIDTH 80
COLOR COUNT 7
GENEALOGY WINTEST/WINTEST WINDOW/CNME1505
Note on the right side of the last line in (b) the WINDOW/CNME1505 text? The GENEALOGY line shows 'parent' and 'grandparent' of the rexx's invocation. Grandparent is the name of the calling procedure or rexx, if it is nested, and in this case it shows the command name "WINDOW" under which the rexx "WINTEST" was invoked, as well as the real command name of the "WINDOW" synonym (CNME1505).
In fact, this technique could be used for other requirements where one wanted to evaluate the calling program, and it is not limited merely to this particular requirement.
Here is how one can utilize this capability in a locally written rexx program, specifically to determine if this rexx was invoked via the WINDOW command. It can of course be tailored to suit customer requirements and preferred programming techniques as needed.
/* rexx*/
'PIPE ENVDATA ',
'| SEP ',
'| LOCATE /GENEALOGY/' ,
'| TAKE 1 ',
'| VAR genealogy'
if pos('WINDOW',genealogy) > 0 then
Window? = 1
else
Window? = 0
if Window? then do
...
(if allowed go ahead and run your process)
...
end
else do
...
(if not allowed, put out error msg and exit)
...
end
exit
Related Information
Historical Number
84826;122;000
Product Synonym
NV NVz NVzOS NETV
Was this topic helpful?
Document Information
Modified date:
08 August 2018
UID
swg21654880