IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SUBSTR ERROR IN ISPF PANEL


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Fri Sep 21, 2012 7:19 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Sep 21, 2012 7:37 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Sep 21, 2012 8:53 pm
Reply with quote

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 icon_redface.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Sep 21, 2012 9:07 pm
Reply with quote

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
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Wed Sep 26, 2012 7:14 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 26, 2012 7:55 pm
Reply with quote

Hello,

Only been here 7 years and will Not use the code tag icon_sad.gif

d
Back to top
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 155

PostPosted: Wed Sep 26, 2012 8:02 pm
Reply with quote

Sorry Dick
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Sep 26, 2012 9:45 pm
Reply with quote

Quote:
data are reset once i process the panel

How can you tell? What does 'reset' mean? Show us the trace.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Sep 27, 2012 9:50 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Sep 28, 2012 3:03 am
Reply with quote

May be doing as designed but designed very badly - so many exits when there should only be 1.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top