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

validate the fields of a mainframe panel using REXX proc


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Hemanth Kumar Guntupalli

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Tue Feb 01, 2011 5:19 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 01, 2011 5:23 pm
Reply with quote

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

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Tue Feb 01, 2011 5:33 pm
Reply with quote

Hi Expat,

That is really quick. Thanks. I see that using VER we can validate a variable in a single panel. Can you show some code of how to call a procedure in a panel to validate?

I went through this link http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.f54dg00/ispzdg60164.htm

Thanks,
Hemanth [/url]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 01, 2011 6:07 pm
Reply with quote

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

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Feb 01, 2011 6:14 pm
Reply with quote

PANEXIT is another option. The concept is similar to embedded Rexx, but it calls an external function.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Feb 01, 2011 6:34 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 01, 2011 7:02 pm
Reply with quote

Dave,

Nice tip icon_fU.gif
Back to top
View user's profile Send private message
Hemanth Kumar Guntupalli

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Wed Feb 02, 2011 10:36 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 02, 2011 10:42 am
Reply with quote

Hello,

What happens? An abend? Syntax error? Unexpected/unwanted result?

What happens if you remove the MSG=HEM00TC?
Back to top
View user's profile Send private message
Hemanth Kumar Guntupalli

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Wed Feb 02, 2011 10:52 am
Reply with quote

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

Global Moderator


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

PostPosted: Wed Feb 02, 2011 8:18 pm
Reply with quote

Where do you put the VER statement? show us the panel.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Wed Feb 02, 2011 9:09 pm
Reply with quote

You need to separate the values in VALFLD with commas. Just as if you were using LIST rather than LISTV.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Feb 02, 2011 9:20 pm
Reply with quote

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

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Thu Feb 03, 2011 10:31 am
Reply with quote

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

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Feb 03, 2011 12:44 pm
Reply with quote

You just need to add a VGET to the second panel....

O.
Back to top
View user's profile Send private message
Hemanth Kumar Guntupalli

New User


Joined: 09 Jun 2007
Posts: 6
Location: bangalore

PostPosted: Thu Feb 03, 2011 1:39 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 03, 2011 8:26 pm
Reply with quote

Good to hear it is working - thank you for posting the resolution icon_smile.gif

d
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
Search our Forums:

Back to Top