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

Validate dataset in ISPF panel


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

New User


Joined: 22 Feb 2008
Posts: 12
Location: United Kingdom

PostPosted: Tue Mar 24, 2009 12:09 pm
Reply with quote

Is there any way we can vaildate dataset to check if it is catloged with in ISPF panels (Not inside Rexx).
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Mar 24, 2009 12:34 pm
Reply with quote

Not with pure ISPF Panel language.

You can, however, write panel exit and call it with PANEXIT, or use the *REXX statement from within the panel.

O.
Back to top
View user's profile Send private message
Pradeep Thangapandy

New User


Joined: 22 Feb 2008
Posts: 12
Location: United Kingdom

PostPosted: Tue Mar 24, 2009 2:55 pm
Reply with quote

Thank you very much. It is working. The script which i have used.

Code:

)PROC
VER(&FILE1,NB,DSNAME)                                       
 *REXX(FILE1)                                           
   IF SYSDSN("'"STRIP(FILE1)"'") <> 'OK' THEN FILE25 = ''
   RETURN                                                 
 *ENDREXX                                                 
IF (&FILE1 = '')                                       
  .MSG=METT390                                                                                 


When I input the file name as "45" validation failed in "VER(&FILE1,NB,DSNAME)" statement and i got the message "Invalid DSN - qualifier". I expected the control should end there(and Rexx script should not be executed). However the Rexx script got executed and i got an error message "INVALID DATA SET NAME, '45'" from SYSDSN rexx script('45' is not a valid dsname).

Is there any way i could skip the rexx statements if invalid DSNAME is keyed in. So that i can avoid the error message from SYSDSN.[/quote]
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Mar 24, 2009 3:03 pm
Reply with quote

This is because you use the *REXX statement unconditionally. You can change the VER statement to IF(VER...) statement. See the fine manual for examples.

Another option is to use the .MSG control variable. This variable is automatically set when a VER statement fails. You then can do something like:
Code:
VER(&FILE1,NB,DSNAME)
VERRC = .MSG
IF VERRC = &Z
  *REXX...


O.
Back to top
View user's profile Send private message
Pradeep Thangapandy

New User


Joined: 22 Feb 2008
Posts: 12
Location: United Kingdom

PostPosted: Wed Mar 25, 2009 4:13 pm
Reply with quote

Many thanks. It is working.

Code:

)PROC
VER(&FILE1,NB,DSNAME)   
IF (VER(&FILE1,NB,DSNAME))                                     
 *REXX(FILE1)                                           
   IF SYSDSN("'"STRIP(FILE1)"'") <> 'OK' THEN FILE1 = ''
   RETURN                                                 
 *ENDREXX                                                 
IF (&FILE1 = '')                                       
  .MSG=METT390   
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top