I have devloped panel listed below and iam validating all panel macros in panel defintion itself and iam facing errors as " Unrecognized keyword" in substr statement in .proc section .
i tried with other possibilities but couldn't able to figure out to solve the issue . Can any one please help me to resolve this issue and alsohow to use inbuilt function (sustr) for panel macro.
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
You have been a member here, balaji, more than long enough to realize that you should have enclosed the panel code in Code tags.
Being, however, the very exemplar of mercy and generosity, I shall overlook your gross solecism (not to mention your poor judgment in posting in the CLIST & REXX forum instead of the TSO/ISPF forum), and merely point out to you that there is, in fact, no SUBSTR function in DMS.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
A quick look in the index of the Dialog Developers Guide and Reference would have told you all you need to know about SUBSTR, or SUSTR, in the .PROC section. All these are terms that you used in your post. That quality of posting, and the fact that you did not code up your panel, and the fact that you seem incapable of looking things up yourself could lead to people ignoring your posts in future. We all have typos and spelling problems and word mis-use but try and keep it to one per post!
Just as well that I double-checked this post - 2 'd' s were missing
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Use the TRUNC builtin (inbuilt) function to isolate the first 4 characters.
But I question why you only accept a single three character ID, but check for 4 characters, but allow the user to type 6 characters. If the only acceptable value is three characters, do not allow the user to type a longer value.
Aside from that, I think your input fields should be HILITE(USCORE) instead of PAD(_) because the underscores are annoying if you mistype and then want to insert a character. And you might have to account for underscore characters in your VER statement.
Now iam handling the user id validation inside my rexx program but data are reset once i process the panel . Please find my code below and i know we need to use 'CONTROL DISPLAY SAVE' and 'CONTROL DISPLAY RESTORE' i tried it but still my values are reset .Can you please help me where i need exactly to put CONTROL DISPLAY SAVE / RESTORE' ,
Code:
ADDRESS ISPEXEC
"CONTROL ERRORS RETURN"
'LIBDEF ISPPLIB DATASET ID('"'"AAA.TEST.PANELS"')"
'LIBDEF ISPMLIB DATASET ID('"'"AAA.TEST.MSGS"')"
ADDRESS ISPEXEC
'DISPLAY PANEL(UTAPANEL) MSG(&ERMSG)'
IF RC = 0 THEN DO
CALL START
EXIT ;END
ELSE
EXIT
END
/* CODE STARTS HERE */
START:
IF APL = ' '
THEN
EXIT
IF U = ' '
THEN
EXIT
IF R = ' '
THEN
EXIT
IF ENTRID = ' '
THEN
EXIT
APPLNAME = APL
UNITTEST = U
REGRTEST = R
USER = ENTRID
IF SUBSTR(USER,1,3) ¬= 'TAM' THEN
DO
ADDRESS ISPEXEC "SETMSG MSG(PRD005)"
ADDRESS ISPEXEC
'DISPLAY PANEL(UTAPANEL) MSG(&PRD00) CURSOR(ENTRID)'
END
Still will not use the Code tag - maybe these should be deleted going forward . . .
Nothing wrong, your program is working as designed...
1. Show the panel once,
2. Validate some fields,
3. If error in fields, terminate the program,
4. If user is not TAM, show the panel once more,
5. Terminate the program.