View previous topic :: View next topic
|
Author |
Message |
Pradeep Thangapandy
New User
Joined: 22 Feb 2008 Posts: 12 Location: United Kingdom
|
|
|
|
Is there any way we can vaildate dataset to check if it is catloged with in ISPF panels (Not inside Rexx). |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
Pradeep Thangapandy
New User
Joined: 22 Feb 2008 Posts: 12 Location: United Kingdom
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
Pradeep Thangapandy
New User
Joined: 22 Feb 2008 Posts: 12 Location: United Kingdom
|
|
|
|
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 |
|
|
|