View previous topic :: View next topic
|
Author |
Message |
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi All,
Good day and Warm greetings!!
I am learning how to Code PANEL via REXX and now i am trying to FETCH information from PANEL, but the information is not fetched properly, my issue is as follows.
1. I have designed a MAIN PANEL with one input option
Enter your Option ==>_
a. 1==>Sub-Panel1
b. 2==>Sub-Panel2
c. 3==>Sub-Panel3
If the USER enters 1 as input user will be routed to Sub-Panel1 / 2--> Sub-Panel2 / 3 --> Sub-Panel3
following design is done for the same.
Code: |
)ATTR
% TYPE(TEXT) INTENS(HIGH) COLOR(TURQ)
@ TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) SKIP(ON)
+ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(RED)
$ TYPE(TEXT) INTENS(HIGH) COLOR(RED)
_ TYPE(INPUT) INTENS(HIGH) JUST(LEFT) COLOR(TURQ)
)BODY EXPAND(\\)
+ @ENTER YOUR OPTION%===>_ZCMD
+
+
+ @1.ABC (SUB-PANEL1)
+
+ @2.BCD(SUB-PANEL2)
+
+ @3.CDE(SUB-PANEL3)
+
+
+PRESS%PF3+TO RETURN.
)INIT
.ZVARS= '(INPUT)'
/)REINIT
)PROC
&ZSEL=TRANS(TRUNC(&INPUT,'.')
1,'PANEL(sub-panel1)'
2,'PANEL(sub-panel2)'
3,'PANEL(sub-panel3)'
' ',' '
*,'?' )
)END
|
I am using the REXX program to execute the above design is as follows
Code: |
"PROFILE NOPREFIX"
"ISPEXEC LIBDEF ISPPLIB DATASET ID('USER.TEST.SOURCE.PANEL')"
"ISPEXEC LIBDEF ISPSLIB DATASET ID('USER.TEST.SOURCE')"
"ISPEXEC ADDPOP"
"ISPEXEC DISPLAY PANEL(PANEL1)"
"ISPEXEC DISPLAY PANEL(SUBPL1)"
"ISPEXEC DISPLAY PANEL(SUBPL2)"
"ISPEXEC DISPLAY PANEL(SUBPL3)"
"ISPEXEC REMPOP"
ARG INPUT
|
I am getting the following error while trying to execute the Main Panel
Code: |
ISPP241
Panel 'PANEL1' error
Number of .ZVARS field names does not equal number of "Z" in/out fields.
Current dialog statement:
DISPLAY PANEL(PANEL1)
|
Kindly help me to identify the mistake that i have committed above.
Thanks a lot for the time. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
seems to me that the message is pretty self explaining
in a panel You code a field as Z when the field size is not wide enough to contain the real field/variable name
very seldom in a selection panel You will need Z fields
( and certainly not at the beginner's level )
in this case just get rid of the ZVARS stuff |
|
Back to top |
|
|
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi Enrico,
Could you please suggest me what is the best way to get the INPUT from the Panel and to the pass the INPUT to the REXX program so that i can try and make it work for my requirment.
Thanks a ton for the time and help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Ramsee, your post shows that error message ISPP241 is displayed. You can use LOOKAT to find the message explanation: See www-03.ibm.com/systems/z/os/zos/bkserv/lookat/
ISPF also has a messages and codes manual which will have the explanation for message ISPP241. See the link that Enrico provided. |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Ramsee, to display your main panel without errors, all you need to do is delete everything in INIT, REINIT & PROC section(including headers), then update _ZCMD to _INPUT.
Later in REXX, you can use IF condition statement with INPUT variable to display your sub-panels. (Ex: if Input = 1 then ....) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
any reason to suggest to the TS to implement his own panel navigation infrastructure
when ISPF will certainly do it in a better way ??? |
|
Back to top |
|
|
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi MFKID,
Thanks for your kind suggesstion on my query!!
I have used the below logic for my requirement.
PANEL DESIGN:
Code: |
)INIT
&INPT = ' '
)REINIT
REFRESH(*)
)PROC
VPUT(INPT) SHARED
VER(&INPT,NB,RANGE,1,3)
|
REXX Code :
Code: |
ADDRESS ISPEXEC "VPUT (INPT) SHARED"
IF INPT = '1' THEN
DO
"ISPEXEC DISPLAY PANEL(SUBPAN1)"
END
IF INPT = '2' THEN
DO
"ISPEXEC DISPLAY PANEL(SUBPAN2)"
END
IF INPT = '3' THEN
DO
"ISPEXEC DISPLAY PANEL(SUBPAN3)"
END
EXIT
|
Above code did exactly what i required with the PANELS.
Please let me know if there is any other way to acheive the above requirement as i was not able to succeed with ZVARS.
Thanks a ton for the Time and Help once again!! |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Great.. I guess you do not need to code "VPUT(INPT) SHARED" in your panel program or REXX. Once you define the input variable (_INPT) in you panel, the variable will be directly accessible from rexx. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
First of all, that can all be done without rexx code as Enrico has said. ISPF can handle it all - look at the code for ISP@PRIM or look in the manual. The only Z variable required is ZCMD.
Second: what is with all those IFs? Why not use SELECT or IF/THEN/ELSE? But preferably no code at all except to display your selection panel. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
Please let me know if there is any other way to acheive the above requirement as i was not able to succeed with ZVARS.
|
the other way is the PROPER way ...
let ISPF handle the navigation
|
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Ramsee, ibmmainframeforum.com might be a better place to post queries related to basic/starter level questions on panel/rexx designs. |
|
Back to top |
|
|
|