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
 
Please tell me what is wrong in the code pasted below.

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

New User


Joined: 25 Mar 2010
Posts: 3
Location: hyderabad

PostPosted: Sat Mar 27, 2010 7:12 pm    Post subject: Please tell me what is wrong in the code pasted below.
Reply with quote

Code:
WHEN EIBAID = DFHPF5                           
  PERFORM RCVMAP                               
  IF WS-RESP = DFHRESP(NORMAL) THEN           
      MOVE 80 TO WS-LEN                       
      EXEC CICS READ                           
         FILE('VSAM142')                       
         INTO(EMPF)                           
         RIDFLD(EMPIDI)                       
         LENGTH(WS-LEN)                       
         UPDATE                               
      END-EXEC                                 
      IF WS-RESP = DFHRESP(NORMAL) THEN       
         EXEC CICS DELETE                     
            FILE('VSAM142')                   
            RESP(WS-RES1)                     
         END-EXEC                             
         MOVE LOW-VALUE TO EMPVMPGO           
         IF WS-RES1 = DFHRESP(NORMAL) THEN     
            MOVE 'RECORD DELETED' TO MSGO     
         END-IF                               
      ELSE                                     
         IF WS-RESP = DFHRESP(NOTFND) THEN     
         MOVE 'READ FAILED' TO MSGO           
         END-IF                               
      END-IF                       [/color]           
  END-IF                                       
  PERFORM SENDMAP     


In the above code, I could successfully test the 'RECORD DELETED' if block..
When I am trying to delete some record which is not existing in VSAM file, then I am not getting 'READ failed' message.
After READ, I could see NOTFND exception, Eventhough I handled it in the code, it is getting abended..instead of displaying the message..

What is the error in the code?

Regards,
Kiran
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Sat Mar 27, 2010 7:22 pm    Post subject:
Reply with quote

Please learn to use the Code button when posting code. I've edited your post to do so this time.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Sat Mar 27, 2010 7:25 pm    Post subject:
Reply with quote

Please note that you are testing WS-RESP for a value. Where is the RESP option on the READ command?
Back to top
View user's profile Send private message
kvkkumar

New User


Joined: 25 Mar 2010
Posts: 3
Location: hyderabad

PostPosted: Sat Mar 27, 2010 7:26 pm    Post subject:
Reply with quote

Thank you..
Back to top
View user's profile Send private message
kvkkumar

New User


Joined: 25 Mar 2010
Posts: 3
Location: hyderabad

PostPosted: Sat Mar 27, 2010 7:30 pm    Post subject:
Reply with quote

Thank you Robert..
It is working fine now.. Sorry for silly mistake..
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Mar 27, 2010 9:38 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Good to hear it is working - thank you for letting us know icon_smile.gif

Quote:
It is working fine now.. Sorry for silly mistake..
Once we know the reason, many things seem silly, though they did not seem silly before the answer was known icon_wink.gif
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
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

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