IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Command variable ZCMD is not strring any value.


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pragati Soni

New User


Joined: 18 Jan 2008
Posts: 47
Location: India

PostPosted: Wed Jun 17, 2009 4:40 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jun 17, 2009 5:09 pm
Reply with quote

Just remove the line with VGET (ZCMD)

Why don't you use?:
Code:
VER (&QHTLLOC,NB,DSNAME)
VER (&QHTLPGM,NB,NAME)
Back to top
View user's profile Send private message
Pragati Soni

New User


Joined: 18 Jan 2008
Posts: 47
Location: India

PostPosted: Wed Jun 17, 2009 5:55 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 17, 2009 9:30 pm
Reply with quote

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
View user's profile Send private message
Pragati Soni

New User


Joined: 18 Jan 2008
Posts: 47
Location: India

PostPosted: Thu Jun 18, 2009 7:37 pm
Reply with quote

Nothing is working..

THE RC is '0' even after typring "EXIT" on Command line. Moreover 'ZCMD' is not storing any value.

icon_sad.gif


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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jun 18, 2009 7:40 pm
Reply with quote

Can you show us your new rexx program? Your original rexx program did not check the return codes.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Jun 19, 2009 12:01 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jun 19, 2009 12:44 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top