View previous topic :: View next topic |
Author |
Message |
pleasehelpme Beginner
Joined: 05 Jun 2007 Posts: 1 Topics: 1
|
Posted: Tue Jun 05, 2007 6:30 am Post subject: DFHCOMMAREA definition in linkage section |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Tue Jun 05, 2007 6:42 am Post subject: |
|
|
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 |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Wed Jun 06, 2007 1:39 am Post subject: |
|
|
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 |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Wed Jun 06, 2007 4:14 am Post subject: |
|
|
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 |
|
 |
|
|