View previous topic :: View next topic
|
Author |
Message |
satya123 Warnings : 1 New User
Joined: 18 Aug 2006 Posts: 57
|
|
|
|
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 |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
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 |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Raghavendra,
Can you please elaborate once again.
Hope this will helps me.
Regard's
Vasanth........ |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
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 |
|
Back to top |
|
|
Earl
Active User
Joined: 17 Jun 2007 Posts: 148 Location: oklahoma
|
|
|
|
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.
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>>
publib.boulder.ibm.com/infocenter/txformp/v5r1/index.jsp?topic=/com.ibm.txseries510.doc/erzhah00.htm |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
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 |
|
|
Earl
Active User
Joined: 17 Jun 2007 Posts: 148 Location: oklahoma
|
|
|
|
Raghavendra,
Good example. 1 comment.
Its not a good idea to code STOP RUN in a CICS program.
use the GOBACK statement.
Earl
|
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
You don't even need the GOBACK, just EXEC CICS RETURN END-EXEC.
Will do the JOB. |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
The newer Compiles used when compiling a CICS program should
generate an ERROR for the STOP RUN. if one is detected. |
|
Back to top |
|
|
Earl
Active User
Joined: 17 Jun 2007 Posts: 148 Location: oklahoma
|
|
|
|
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.
|
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi,
Sorry
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 |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Raghavendra,
Can we do check the cobl abends using CICS HANDLE condition. if not pls give me the information.
regard's
Vasanth......... |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
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 |
|
|
Earl
Active User
Joined: 17 Jun 2007 Posts: 148 Location: oklahoma
|
|
|
|
review documentation on
CICS HANDLE ABEND |
|
Back to top |
|
|
|