MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DFHCOMMAREA definition in linkage section

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
pleasehelpme
Beginner


Joined: 05 Jun 2007
Posts: 1
Topics: 1

PostPosted: Tue Jun 05, 2007 6:30 am    Post subject: DFHCOMMAREA definition in linkage section Reply with quote

I have defined the DFHCOMMAREA in the linkage section as X(49). The return statement in my program passes the COMM area data which is of size greater than 49. But the program does not abend and seems to work just fine with access to all the data which was sent last time using the following Move statement.
MOVE DFHCOMMAREA(1:EIBCALEN) TO WS-WORKAREA
How can this work? Is the size defined in the linkage section of no significance?
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Tue Jun 05, 2007 6:42 am    Post subject: Reply with quote

True, the size of the 01 in linkage is of no real significance. The data description in linkage allows the program to access the data directly. The main use it the address of the 01 dataname, a pointer to the data. Your MOVE take advantage of that address and relies on CICS for the length.
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Jun 06, 2007 1:39 am    Post subject: Reply with quote

FALSE!!!! The size of the linkage section definition can be critical!!. The initial use of a DFHCOMMAREA always has to be initiated using working storage. If your program is only reading the dfhcommarea that has already been created there should be no problems, but it is not good programming practice. You should always check and see if you are actually getting the dfhcommarea that you are expecting, another words the EIBCALEN should be equal to the length of the dfhcommarea that you have defined, if it is not your program should give an error message and terminate. If you move to a dfhcommarea that is defined to be larger than the actual length of the dfhcommarea (eibcalen) you will produce a storage violation and jeopardize the whole cics system. Please read the threads on storage vioation. A good practice would be to define the commarea as below where 24576 is the max expected length of the commarea.
01 DFHCOMMAREA.
05 PIC X OCCURS 24576 depending on EIBCALEN.
Back to top
View user's profile Send private message Visit poster's website
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Jun 06, 2007 4:14 am    Post subject: Reply with quote

warp5 wrote:
The initial use of a DFHCOMMAREA always has to be initiated using working storage.
FALSE!!!! The initial source can be any valid storage, including storage defined in linkage.
The rest of your points are valid but I still stand by my previous statements with the addendum that if you abuse the length, you will pay the price.....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group