Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

HANDLE CONDITION after each cics statement

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

New User


Joined: 18 Aug 2006
Posts: 57

PostPosted: Thu Nov 01, 2007 11:18 am    Post subject: HANDLE CONDITION after each cics statement
Reply with quote

HI All,

Can i have HANDLE condition, after each cics statement????I was told that HANDLE CONDITION is coded after the procedure division and before the cics statement and if any error occurs contol will go to the respective paragraph.

I used HANDLE CONDITION after send command but did not worked but when i used before send command it worked.

please share some idea.

satya123
Back to top
View user's profile Send private message

vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 11:31 am    Post subject: Hi....
Reply with quote

Hi,


Answering to this question Handle Condition is used to trap the errors occured or exception in CICS programming.

Ya its works before send command, when user enters the data in the map while receiving the data from the user, we usually have to use the handle condition for error traping.

for more answer to your query check below.

http://publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com.ibm.cics.ts31.doc/dfhp3/dfhp3a0.htm


Regard's

Vasanth........ icon_smile.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Nov 01, 2007 3:39 pm    Post subject:
Reply with quote

Most EXEC CICS commands are translated into COBOL commands (mostly MOVE and CALL).
HANDLE CONDITION does not: look at your COBOL compilation listing.

This is because this command is destinated to the CICS pre-compiler.

As the pre-compiler scans the source program from top to bottom, without respect for the logic, it must located before (in a physical way, not logical) the commands it will affect
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 01, 2007 4:38 pm    Post subject:
Reply with quote

Marso wrote:
Most EXEC CICS commands are translated into COBOL commands (mostly MOVE and CALL).


Dear Marso i disagree, what did you in last post.

Under CICS, Each CICS statement is having a CICS management routine.
<The CICS COBOL translator converts the EXEC CICS commands into valid COBOL language "CALL" statements called arguments which inturn invoke CICS management routine during execution>

When the program running, The EIP<Execute interface program> is invoked in CICS when the COBOL program issues the CALL statements inserted by the translator. The EIP invokes other CICS management programs based on the arguments passed by the CALLs

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

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 5:03 pm    Post subject:
Reply with quote

Hi Raghavendra,


Can you please elaborate once again.

Hope this will helps me.

Regard's
Vasanth........ icon_smile.gif
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 01, 2007 5:26 pm    Post subject:
Reply with quote

vasanthkumarhb wrote:

Can you please elaborate once again



Dear Vasanth,

In COBOL Program
---------------------------

Consider a COBOL Program, to execute this first we have convert into machine language to do so we are having a compiler called IGYCRCTL for compiling and for linkedit we are having IEWL/IHEL linker, after linedit it will convert source program into machine language, this is the language the computer can understand its like .EXE file.

But

In COBOL-CICS Program
--------------------------------

There are 2 components
1. Transalator
2. EIP<Execute interface Block>

In COBOL-CICS Program, The compiler IGYCRCTL cann't understand CICS statement so the translator will be used to convert each CICS statement into CALL Statement
<having arguments some arguments in CALL statements>
Then COBOL Compiler IGYCRCTL will take transalated code then will link edit with IEWL and convert it into machine language

During execution, when it found CALL Statement, it will invoke
pre-defined managament routine with the help of EIP

<EIP-This is another component which inturn invoke management routine>

<MANAGEMENT ROUTINE IS NOTHING BUT PRE-DEFINED ROUTINE FOR CICS STATEMENT, EACH CICS STATEMENT WILL HAVE PRE DEFINED CICS MANAGEMENT ROUTINE>

hope i explained as my best

Regards,
Raghavendra icon_razz.gif
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Thu Nov 01, 2007 7:19 pm    Post subject:
Reply with quote

Can i have HANDLE condition, after each cics statement????I

You can code a HANDLE CONDITION anywhere in your program,
but is only effective for the
next logical CICS command.

Common practice is to code HANDLE CONDITION before the
CICS command you need to test conditions for:

In the following example,

IF the READ DATASET returns a "record not found condition", the
logic flow will transfer (GO TO) a paragraph called 8000-RECORD-NOTFOUND


EXEC CICS HANDLE CONDITION
NOTFND (8000-RECORD-NOTFOUND) END-EXEC.

EXEC CICS READ DATASET ('FILEA')
INTO (WS-FILEA) RDIDFLD('WS-REC-KEY)
END-EXEC.





You can also eliminate using the HANDLE CONDITION command,
by coding NOHANDLE on the target CICS command and checking
EIBRESP after each command.


EXEC CICS READ DATASET ('FILEA')
INTO (WS-FILEA-RECORD)
RDIDFLD (WS-KEY) NOHANDLE
END-EXEC.

IF EIBRESP GREATER THAN ZEROS
MOVE 'N' TO WS-RECORD-FOUND-SWITCH
ELSE
MOVE 'Y' TO WS-RECORD-FOUND-SWITCH.


icon_idea.gif
I used HANDLE CONDITION after send command but did not worked but when i used before send command it worked.


take a look at IBM manual>> icon_idea.gif icon_idea.gif icon_idea.gif
http://publib.boulder.ibm.com/infocenter/txformp/v5r1/index.jsp?topic=/com.ibm.txseries510.doc/erzhah00.htm
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 02, 2007 12:14 pm    Post subject:
Reply with quote

Quote:


I used HANDLE CONDITION after send command but did not worked but when i used before send command it worked.


Just to add to EARL thoughts,

Find below will explain the use of HANDLE CONDITION

-------------------------------------------------------------------------------------

1.

IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
.
.
.

PROCEDURE DIVISION.
0000-MAIN.
EXEC CICS HANDLE CONDITION
MAPFAIL(1000-MAPFAIL)
LENGERR (2000-LENGERR)
END-EXEC.
.
.
<CICS Statement>
.
.
.
___________________________________________________________
MARKER
.
.
.
<CICS Statement>
.
.
STOP RUN.

1000-MAPFAIL.
.
2000-LENGERR.
.
ABEND-PARA
.



The HANDLE Condition in above program will be in effective till end of programs mean through out programs,

In case CICS statements after MARKER encounter say LENGTH ERROR, The HANDLE Condition will perform 2000-LENGERR

Note: The HANDLE CONDITION will only effective for proceeding CICS Statements.


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

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Fri Nov 02, 2007 7:38 pm    Post subject:
Reply with quote

Raghavendra,


Good example. 1 comment.

Its not a good idea to code STOP RUN in a CICS program.

use the GOBACK statement.


Earl
icon_biggrin.gif
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Sat Nov 03, 2007 3:03 am    Post subject:
Reply with quote

You don't even need the GOBACK, just EXEC CICS RETURN END-EXEC.
Will do the JOB.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Sat Nov 03, 2007 3:04 am    Post subject:
Reply with quote

The newer Compiles used when compiling a CICS program should
generate an ERROR for the STOP RUN. if one is detected.
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Sat Nov 03, 2007 3:15 am    Post subject:
Reply with quote

yea, in the old days, on a VSE machine, STOP RUN, would do just that, STOP RUN the entire CICS region with a clean shutdown..

It was a good way to drive your CICS Systems Programmer crazy.

icon_biggrin.gif
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Nov 05, 2007 10:18 am    Post subject: Hi all,
Reply with quote

Hi,

Sorry

Quote:
STOP RUN


is just a typing mistake.

Just to share information,

Code:
STOP RUN - It will pass control back to OS
GOBACK   - It will pass control first to Calling program then to OS   
                   (operating system)


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

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Mon Nov 05, 2007 10:42 am    Post subject:
Reply with quote

Hi Raghavendra,



Can we do check the cobl abends using CICS HANDLE condition. if not pls give me the information.



regard's
Vasanth......... icon_smile.gif
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Nov 05, 2007 2:57 pm    Post subject:
Reply with quote

Dear Vasanth,

No, As per my knowledge, we cann't check the COBOL ABENDS using CICS Statements

<HANDLE CONDITION is meant for only handle CICS EXCEPTION)

Any how we can handle it using ABEND-ROUTINE(this is pre defined routine normally used for to handle COBOL abends)

Any suggestion is welcomed

Regard's,
Raghavendra
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Mon Nov 05, 2007 8:18 pm    Post subject:
Reply with quote

review documentation on

CICS HANDLE ABEND
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 CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us