Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Validate dataset in ISPF panel

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Validate dataset in ISPF panel
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: 2360
Location: Israel

PostPosted: Tue Mar 24, 2009 12:34 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Mar 24, 2009 3:03 pm    Post subject:
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    Post subject: Reply to: Validate dataset in ISPF panel
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us