Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to skip Special Charaters on a CICS Screen?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
santoshkumarmanilakkoju

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Mon Oct 01, 2012 4:57 pm    Post subject: How to skip Special Charaters on a CICS Screen?
Reply with quote

Hi, I have requirement to populate a Error messae when user enters data on CICS Screen. Filed is defined as Alphanumeric and length of 3 bytes.

Conditions-
1) User cannot enter Special charaters;
2) User can enter data which is not case sensitive;
3) User cannot enter few specific codes;

Code:
IF FIELD-L = 0                             
   IF FIELD-A = EOF-KEY                     
      NEXT SENTENCE                                     
   END-IF                                               
ELSE                                                     
   IF FIELD-L > 0                           
      IF FIELD = 'CCL' OR 'NET' OR         
                     'ACC' OR 'OIU' OR 'PIE' OR 'OTH'   
         MOVE 'A'    TO LS-ERROR-TYPE                   
         MOVE 'A'  TO FIELD-A
         MOVE -1  TO FIELD-L               
      ELSE                                               
         MOVE FIELD                         
           TO FIELD2
         MOVE 'Y'    TO TRAILER-X
         MOVE 'A'  TO FIELD-A
      END-IF                                             
ELSE                                                     
    NEXT SENTENCE                                       
   END-IF                                               
END-IF.


Is there a way to handle Special characters in the ELSE part?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Mon Oct 01, 2012 5:30 pm    Post subject:
Reply with quote

This is an excellent example for implementation of the EVALUATE Statement.

Do that and your problem is solved.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Mon Oct 01, 2012 5:32 pm    Post subject: Reply to: How to skip Special Charaters on a CICS Screen?
Reply with quote

Yes.

Firstly, don't use NEXT SENTENCE. Replace with CONTINUE. This won't help with your requirement, but will help if someone ever removes the fullstop/period on your final END-IF. This also applies to any IF you or anyone at your site or anyone anywhere has ever coded.

Since the advent of Cobol II, around about the end of the Cretaceous Period, NEXT SENTENCE is nothing but "an accident waiting to happen". Not bothering with fullstops/periods at all except to precede a procedure-name, END-PROGRAM, end of the program and to end the PROCEDURE DIVISION statement might take longer to sink in, but it'll only help in the "long run" (I mean for coding future, not for execution times of steps).

Why don't you use an 88 on FIELDD? Can be made a descriptive name and makes the code much tidier and easier to maintain (as it has a name).

Why is FIELDD, and for that matter FIELDD2, called that? Can't it be something more descriptive? Helps to understand/maintain the program and reduces stupid coding errors.

To your requirement, how about telling is what is "valid" in the field, rather than that you want to reject something called "special characters" which only means whatever any person says at any given time?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Mon Oct 01, 2012 5:56 pm    Post subject:
Reply with quote

silly of me to preach without practicing:

Code:
EVALUATE TRUE
    WHEN FIELD-L < 1
         PERFORM NO-DATA-ROUTINE
    WHEN FIELD-IS-A-K-L-R-S-Z-0-9
         CONTINUE

(As Bill says, make these 88's  = 'CCL' OR 'NET' OR 'ACC' OR 'OIU' OR 'PIE' OR 'OTH'
    WHEN FIELD-IS-CLASS1 
         MOVE 'A' TO LS-ERROR-TYPE                   
         MOVE 'A' TO FIELD-A
         MOVE -1  TO FIELD-L               
    WHEN ......
END-EVALUATE

2 WHEN's (compares) and acceptable data is moving on in the program.
the remaining WHEN's isolate individual error conditions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is CICS BMS logic on z/OS different ... Andi1982 CICS 2 Fri Dec 01, 2017 1:56 pm
No new posts How to get complete URL from CICS Con... mbattu CICS 1 Tue Nov 14, 2017 11:59 pm
No new posts Integrating CICS applications craig2020 CICS 1 Sun Oct 29, 2017 6:49 pm
No new posts ASP3 ABEND IN CICS Vedant CICS 0 Fri Oct 20, 2017 3:18 pm
No new posts Identifying Interfaces in CICS/mainframe Ashishpanpaliya CICS 5 Fri Oct 13, 2017 3:21 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us