Joined: 03 Oct 2009 Posts: 1780 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.
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: 2088 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' ,
"CONTROL ERRORS RETURN"
'LIBDEF ISPPLIB DATASET ID('"'"AAA.TEST.PANELS"')"
'LIBDEF ISPMLIB DATASET ID('"'"AAA.TEST.MSGS"')"
'DISPLAY PANEL(UTAPANEL) MSG(&ERMSG)'
IF RC = 0 THEN DO
/* CODE STARTS HERE */
IF APL = ' '
IF U = ' '
IF R = ' '
IF ENTRID = ' '
APPLNAME = APL
UNITTEST = U
REGRTEST = R
USER = ENTRID
IF SUBSTR(USER,1,3) ¬= 'TAM' THEN
ADDRESS ISPEXEC "SETMSG MSG(PRD005)"
'DISPLAY PANEL(UTAPANEL) MSG(&PRD00) CURSOR(ENTRID)'
Still will not use the Code tag - maybe these should be deleted going forward . . .