View previous topic :: View next topic
|
Author |
Message |
Pragati Soni
New User
Joined: 18 Jan 2008 Posts: 47 Location: India
|
|
|
|
When I execute the above panel using REXX, the variable ZCMD doesn't store any value.
Code: |
)PANEL KEYLIST(ISRSAB ISR)
)ATTR
@ TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) SKIP(ON)
$ TYPE(INPUT) INTENS(LOW) COLOR(RED)
_ TYPE(NEF) PAD(USER) CAPS(ON)
)BODY
%----------------------QHTOOL SUBMIT PANEL----------------------------%
%COMMAND ===> _ZCMD %
@ EDIT JCL ===> $J@(Y/N) +
+ +
@QHTOOL PROGRAM PDS* ===> $QHTLLOC @+
+(GIVE A FULLY QUALIFIED PDS NAME WITHOUT QUOTES) +
+ +
@MEMBER* ===> $QHTLPGM @ @DB2 ===> $D@(Y/N) +
+(GIVE A VALID MEMBER NAME WITHOUT QUOTES) +
+ +
@VSAM REGION QUALIFIER* ===> $REGN @ +
@ FOR E.G.: EVBV, FNBV, SUPV.SSUP +
+ +
@NOTE: +
@BY DEFAULT: +
@ => LOADLIB PRD.Y00XXX.LOADLIB IS ADDED WHERE XXX IS THE USERID +
@ => OUTPUT WILL GO INTO SPOOL IN QHPRINT. +
@ => COMMON DATABASES CDMF, AMF, CIF AND ADF ARE ALREADY ADDED. +
@SPECIFY EDIT JCL => Y FOR THE FOLLOWING: +
@FOR MORE INPUT FILES/DATABASES OR OUTPUT FILES, ADD TO QHEXEC +
+ +
+%PRESS PF1 FOR HELP,ENTER TO SUBMIT AND PF3 OR PF12 TO EXIT +
)INIT
.HELP = QHTLHLP
IF (&J = ' ')
&J = 'N'
IF (&D = ' ')
&D = 'N'
)PROC
VER (&J,NB,LIST,'Y','N')
VER (&D,NB,LIST,'Y','N')
VER (&QHTLLOC,NB)
VER (&QHTLPGM,NB)
VPUT (J QHTLLOC QHTLPGM LOADLIB REGN D) PROFILE
VGET (J QHTLLOC QHTLPGM LOADLIB REGN D) PROFILE
)END |
Rexx Code
Code: |
/*REXX*/
/*"ISPEXEC CONTROL ERRORS RETURN"*/
MAIN_PANEL:
"ISPEXEC LIBDEF ISPPLIB DATASET ID('PRD.Y00XXX.QHTOOL.PANEL')"
"ISPEXEC ADDPOP"
"ISPEXEC DISPLAY PANEL(SUBQHTL)"
"ISPEXEC VGET (ZPFKEY)"
"ISPEXEC VGET (ZCMD)"
SAY ZCMD
IF (ZPFKEY = 'PF03' | ZPFKEY = 'PF12' | ZCMD = 'EXIT') THEN
DO
EXIT
END |
Please suggest me something. Based on the value it stores I need to perform some action but the issue is it always stores spaces.
Thanks in advance. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Just remove the line with VGET (ZCMD)
Why don't you use?:
Code: |
VER (&QHTLLOC,NB,DSNAME)
VER (&QHTLPGM,NB,NAME) |
|
|
Back to top |
|
|
Pragati Soni
New User
Joined: 18 Jan 2008 Posts: 47 Location: India
|
|
|
|
Removing the line VGET (ZCMD) is not sorting out the problem. ZCMD variable is spaces further in the code
My issue is whenever I type 'EXIT' on command, it works for the first time only and if any verfication fails then if we type 'EXIT' to come out it doesn't work. PF3 works.
Also it is not giving error for invalid commands.
My requirement is if ZCMD is spaces only then a particular function like JCL submission should happen. But ZCMD is always spaces (exception if we enter the panel for the first time and write 'EXIT', only then we come out of the panel and ZCMD has "EXIT'. In all other cases we never come out) hence the jcl always gets submitted.
Please suggest.
Marso wrote: |
Just remove the line with VGET (ZCMD)
Why don't you use?:
Code: |
VER (&QHTLLOC,NB,DSNAME)
VER (&QHTLPGM,NB,NAME) |
|
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
ISPF handles 'exit' for you. Your application will see RC=8 after the display. Check for return code 8 and exit your application.
But check ZCMD for your private commands.
If you want to check EXIT by yourself, you should call your program with SELECT with NEWAPPL parameter and create an application command table. |
|
Back to top |
|
|
Pragati Soni
New User
Joined: 18 Jan 2008 Posts: 47 Location: India
|
|
|
|
Nothing is working..
THE RC is '0' even after typring "EXIT" on Command line. Moreover 'ZCMD' is not storing any value.
Pedro wrote: |
ISPF handles 'exit' for you. Your application will see RC=8 after the display. Check for return code 8 and exit your application.
But check ZCMD for your private commands.
If you want to check EXIT by yourself, you should call your program with SELECT with NEWAPPL parameter and create an application command table. |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Can you show us your new rexx program? Your original rexx program did not check the return codes. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
Also it is not giving error for invalid commands. |
I think you need to check your own commands and issue your own messages.
Quote: |
My requirement is if ZCMD is spaces only then a particular function like JCL submission should happen. But ZCMD is always spaces (exception if we enter the panel for the first time and write 'EXIT', only then we come out of the panel and ZCMD has "EXIT'. In all other cases we never come out) hence the jcl always gets submitted. |
I think you have not shown us some of your logic... no hint of job submission in your rexx program. And there is nothing 'to get out of' because there is no loop. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I copied that code for the panel, and ran it on my machine. I'm not seeing an issue, although I don't see where the user is prompted to enter any commands that zcmd might use. When I did enter a command, like UPDATE, it showed that zcmd DID contain the value of UPDATE. |
|
Back to top |
|
|
|