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

EIBCALEN and LENGTH of DFHCOMMAREA


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Wed Apr 01, 2009 11:48 pm
Reply with quote

Quote:
Verify the length and content of COMMAREAs. Many programmers check for the presence of a COMMAREA by simply checking to see if EIBCALEN is greater than zero and, if true, moving the LINKAGE SECTION item DFHCOMMAREA into a WORKING STORAGE area. This technique may seem proper on the surface, but it is not. CICS has no knowledge of the length of the LINKAGE SECTION item DFHCOMMAREA. The length and layout of this item are set at compile time. At execution time, the actual length passed from the invoking program is provided in the EIB item EIBCALEN. It is the called program's responsibility to insure that EIBCALEN matches the compile time length of DFHCOMMAREA. Failure to verify that EIBCALEN matches the length of the DFHCOMMAREA passed can lead to ASRA 0C4 ABENDs, storage overlays, or invalid data being moved into the working storage area of a program.

Can we go by the above statement.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 01, 2009 11:51 pm
Reply with quote

Quote:
Failure to verify that EIBCALEN matches the length of the DFHCOMMAREA passed can lead to ASRA 0C4 ABENDs, storage overlays, or invalid data being moved into the working storage area of a program.
Yes.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 01, 2009 11:55 pm
Reply with quote

Yes -- it is incumbent upon the programmer to check that the expected length of DFHCOMMAREA is what was received per EIBCALEN. I have seen an error occur, from a copybook change not propagated to all programs, where the DFHCOMMAREA length was 6 bytes longer than expected -- a storage violation eventually occurred.
Back to top
View user's profile Send private message
Succor

New User


Joined: 20 Feb 2009
Posts: 96
Location: Bangalore :)

PostPosted: Thu Apr 02, 2009 12:08 am
Reply with quote

Thanks ,i was expecting to hear from both of you.
To conclude
Quote:
The length of DFHCOMMAREA is set at compile time which should be checked against the execution time EIBCALEN value ...before going for a move.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 02, 2009 12:17 am
Reply with quote

Quote:
The length of DFHCOMMAREA is set at compile time....
It could be, but it doesn't need to be. It is usually set at execution time.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Apr 02, 2009 1:55 am
Reply with quote

If you define a WS area as PIC X(32763), which is the maximum length of a commarea, then (providing EIBCALEN > ZERO), move SPACES to the WS area and then use reference modification to move DFHCOMMAREA (1:EIBCALEN) to WS-COMMAREA (1:EIBCALEN). As a fail-safe, save EIBCALEN in a WS variable.

Storage (for the most part) is no longer an issue and 32K-4 in WS is nothing to worry about.

Regards,
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top