View previous topic :: View next topic
|
Author |
Message |
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
|
|
Hi,
I have 20 panels with several fields as inputs. In most of them I have similar fields that need to be validated and their validation keeps changing based on my shops requirement.
My question here is, is there way I can write a REXX procedure to validate all the relevant fields and throw message back to panel.
Thanks in advance,
Hemanth |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well, a Yes/No question deserves a Yes/No answer.
The answer is Yes
Or you could read the ISPF manuals to find out about VER |
|
Back to top |
|
|
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can build REXX in to an ISPF panel, or you can exit the panel to do the validation from a procedure and then redisplay the panel with the required messages.
AFIK, you can not call procedures from panels |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
PANEXIT is another option. The concept is similar to embedded Rexx, but it calls an external function. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What I do is use VER with LISTV. Here is an example:
Code: |
VER (&PANFLD1,NB,LISTV,&VALFLD1) |
I load in all the valid values for FLD1 (with a space between them) into VALFLD1 in the REXX program before displaying the panel.
These valid values can be kept in a sequential file, a pds member or an ISPF Table (which I often use). This is all that needs to change when valid values are added or removed.
This should be enough to get you started. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Dave,
Nice tip |
|
Back to top |
|
|
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
|
|
Dave,
That's nice tip. But it doesn't work for me yet. Could you please review my code.
I have tried this way in my REXX program that calls the panel.
VALFLD = 'C E S R'
In the panel, I have given the below way.
VER (&CTY,NB,LISTV,&VALFLD,MSG=HEM00TC)
Please validate.
Thanks in advance,
Hemanth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What happens? An abend? Syntax error? Unexpected/unwanted result?
What happens if you remove the MSG=HEM00TC? |
|
Back to top |
|
|
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
|
|
Hi,
There is no abend. Even for a valid value the message panel is thrown.
My intention is not to remove the MSG panel, because I want this specific panel to be thrown in case of invalid value.
Thanks,
Hemanth |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Where do you put the VER statement? show us the panel. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
You need to separate the values in VALFLD with commas. Just as if you were using LIST rather than LISTV. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Don,
It may work with commas, but my experience is with spaces.
I have a dozen panels using spaces in between the values.
That is all I know. |
|
Back to top |
|
|
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
|
|
Hi All,
Thanks for your time. LISTV is working for me if a program PROG calls PANELA. But, the same if PANELA calls PANELB, PANELB is not able to identify the variables defined my PROG.
How I achieved sofar..
In my PROG I have given
"ISPEXEC VPUT VALFLD PROFILE"
In my Panel in )INIT I have given
VGET (VALFLD) PROFILE
In )PROC I just used as LISTV,&VALFLD. it worked.
Now my question is about passing this global variable to susequent panels.
Please help me.
Thanks in advance,
Hemanth [/u] |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You just need to add a VGET to the second panel....
O. |
|
Back to top |
|
|
Hemanth Kumar Guntupalli
New User
Joined: 09 Jun 2007 Posts: 6 Location: bangalore
|
|
|
|
Hi Guys,
Sorry. there is a mismatch of my variables. Please consider what I mentioned earlier working fine..
Thanks to all.
Hemanth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for posting the resolution
d |
|
Back to top |
|
|
|