|
View previous topic :: View next topic
|
| Author |
Message |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
Hi,
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.
| Code: |
)ATTR FORMAT(MIX)
% TYPE(TEXT) INTENS(HIGH)
+ TYPE(TEXT) INTENS(LOW)
* TYPE(TEXT) INTENS(HIGH) COLOR(GREEN)
# TYPE(TEXT) INTENS(HIGH) COLOR(YELLOW)
{ TYPE(TEXT) INTENS(HIGH) COLOR(WHITE)
¬ TYPE(TEXT) INTENS(HIGH) COLOR(TURQ)
@ TYPE(TEXT) INTENS(HIGH) COLOR(RED)
_ TYPE(INPUT) COLOR(GREEN) PAD(_) CAPS(OFF)
! TYPE(OUTPUT) COLOR(RED) PAD(_)
$ TYPE(TEXT) COLOR(YELLOW) PAD(_)
)BODY
$
%
%
% #MENU TESTING
%
%
% ¬APPLICATION +_APL+
%
% ¬UNIT TESTING +_U+
%
% ¬REGRESSION TEST +_R+
%
% ¬USER ID +_ENTRID+ +
% +
% +
% +
% +
% +
% +
% +
% @PF3+- EXIT @ENTER+- PROCESS +
% +
)INIT
&ZCMD = ' '
&APL = ' '
&U = ' '
&R = ' '
&ENTRID = ' '
)REINIT
.CURSOR = &CURS
.ATTR(.CURSOR) = 'COLOR(RED) HILITE(BLINK)'
)PROC
VER(&APL,NB,MSG=PRD001)
VER(&U ,NB,MSG=PRD001)
VER(&R ,NB,MSG=PRD001)
VER(&ENTRID,NB,MSG=PRD001)
VER(&U,LIST,'Y','N',MSG=PRD002)
VER(&R,LIST,'Y','N',MSG=PRD002)
VER(&APL,LIST,'AAA','BBB','CCC','GGG','HHH','TTT',
'YYY',MSG=PRD003)
IF (&U = 'Y' AND &R= 'Y') .MSG=PRD004
VER(SUBSTR(&ENTRID,1,4),LIST,'TAM',MSG=PRD005) <- error showing
IF (.RESP = END)
&OFLAG = 'Y'
VPUT (OFLAG)
IF (.RESP = END)
EXIT
VPUT (APL U R ENTRID) PROFILE
)END |
|
|
| Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 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. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 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  |
|
| Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2624 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. |
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
Hi Pedro Vera,
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 . . . |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Only been here 7 years and will Not use the code tag
d |
|
| Back to top |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
| Sorry Dick |
|
| Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2624 Location: Silicon Valley
|
|
|
|
| Quote: |
| data are reset once i process the panel |
How can you tell? What does 'reset' mean? Show us the trace. |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
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. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| May be doing as designed but designed very badly - so many exits when there should only be 1. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|