View previous topic :: View next topic |
Author |
Message |
Mouli Beginner
Joined: 07 Jun 2003 Posts: 18 Topics: 7
|
Posted: Tue Jun 10, 2003 9:51 am Post subject: DFHCOMMAREA - Clarification Required |
|
|
Hi,
I have defined the DFHCOMMAREA in linkage section as
01 DFHCOMMAREA PIC X(40).
I also defined in working storage section as
Code: |
01 COMM-AREA.
05 COMM-A PIC X(20).
05 COMM-B PIC X(30).
05 COMM-C PIC X(30).
|
In the return statement, i have given the length as 80.
i.e
Code: |
EXEC CICS RETURN
TRANSID('XXXX')
COMMAREA(COMM-AREA)
LENGTH(LENGTH OF COMM-AREA)
END-EXEC
|
When i do
MOVE DFHCOMMAREA(1:EIBCALEN) TO COMM-AREA (once the control comes back again)
I am getting full comm-area, i.e full length of 80 byts!.
Even if I define like
01 DFHCOMMAREA PIC X(10).
I am able to get the full length what i have given in the Return statement!..
Any specific reason for this. Hope I am clear in my questions  _________________ Regards,
Mouli |
|
Back to top |
|
 |
manojagrawal Beginner

Joined: 25 Feb 2003 Posts: 124 Topics: 29
|
Posted: Wed Jun 11, 2003 3:08 am Post subject: |
|
|
Hi,
Let me guess on this. I may be wrong. If so, please correct me.
Its a possbility that when you move DFHCOMMAREA to COMMAREA, as you are moving EIBCALEN number of characters, it is moving the entire memory area from the starting point of DFHCOMMAREA.
Basically, when you return the COMMAREA of 80 chars, and transid XXXX is invoked, this 80 bytes goes to DFHCOMMAREA. even though DFHCOMMAREA is 10 or 40 bytes, I guess the remaining data is still allocated to the bytes after these 10 or 40. So when you move that entire area of 80 bytes, you get all the data.
Replace EIBCALEN in the move statement with 10 or 40 and I guess you would not get the entire data. _________________ Thanks & Regards,
Manoj. |
|
Back to top |
|
 |
vallishar Beginner

Joined: 17 Dec 2002 Posts: 53 Topics: 14 Location: BengaLuru
|
Posted: Wed Jun 11, 2003 3:18 am Post subject: |
|
|
Hi Mouli,
As I know, when you have defined the DFHCOMMAREA as 40 bytes, you can pass 40 bytes of data to a called / linked program. After you move the same to a variable of 80 bytes, it is obvious that you would get 80 bytes of data, which might consist of 40 bytes of DFHCOMMAREA the rest may be spaces.
If I am not clear, please post the sample code which you are using.
Refer to this link for details about the MOVE statement
MOVE
Thanks,
Vallish _________________ If you're not failing every now and again, it's a sign you're not doing anything very innovative. |
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Wed Jun 11, 2003 5:55 am Post subject: |
|
|
You should have your DFHCOMMAREA defined as large as you expect it to be. Then you should check that the EIBCALEN is what it should be. They should be identical and you should check this. If you are getting a wrong EIBCALEN and then write a larger length back to the DFHCOMMAREA you will have serious problems, if not CICS crashes. The DFHCOMMAREA logic must be understood and is critical to having a stable CICS system. A new or larger DFHCOMMAREA must always be built from working storage, as you did in your example. |
|
Back to top |
|
 |
Mouli Beginner
Joined: 07 Jun 2003 Posts: 18 Topics: 7
|
Posted: Tue Jun 17, 2003 3:04 am Post subject: |
|
|
Hi all,
Thanks for all your response. As Manoj mentioned, we too thought the same. Might be when we return with the length, it will always keep the maximum length mentioned in the Return statement. Hence DFHCOMMAREA, eventhough defined as less length, all the vaues are populated in WSS.
But if this is the case, then why we need to define dfhcommarea as X(1000) or other. We can simply define as
01 DFHCOMAREA X(10).
In working storage section we will include all the necessary fields required and return the length right!!. Because in most of the programs in production the WSS Commarea is synch with DFHCOMMAREA!.
Quote: |
"After you move the same to a variable of 80 bytes, it is obvious that you would get 80 bytes of data, which might consist of 40 bytes of DFHCOMMAREA the rest may be spaces"
|
Vallish,
I got all the values to the WSS field. Whatever I have returned, I got that.
The code is same what I had mentioned already in my question.
Opinions are welcome  _________________ Regards,
Mouli |
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Fri Jun 20, 2003 2:08 am Post subject: |
|
|
Even if your program works with a wrong length of DFHCOMMAREA does not mean that it is good programming. Do you want to confuse the next guy who tries to change your program? And besides that, you could describe another field in the linkage that comes after the DFHCOMMAREA and you could have serious problems working with it. Being lazy usually will bite back later. |
|
Back to top |
|
 |
|
|