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 - Clarification Required

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


Joined: 07 Jun 2003
Posts: 18
Topics: 7

PostPosted: Tue Jun 10, 2003 9:51 am    Post subject: DFHCOMMAREA - Clarification Required Reply with quote

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 Razz
_________________
Regards,
Mouli
Back to top
View user's profile Send private message
manojagrawal
Beginner


Joined: 25 Feb 2003
Posts: 124
Topics: 29

PostPosted: Wed Jun 11, 2003 3:08 am    Post subject: Reply with quote

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
View user's profile Send private message
vallishar
Beginner


Joined: 17 Dec 2002
Posts: 53
Topics: 14
Location: BengaLuru

PostPosted: Wed Jun 11, 2003 3:18 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
warp5
Intermediate


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

PostPosted: Wed Jun 11, 2003 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mouli
Beginner


Joined: 07 Jun 2003
Posts: 18
Topics: 7

PostPosted: Tue Jun 17, 2003 3:04 am    Post subject: Reply with quote

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 Laughing
_________________
Regards,
Mouli
Back to top
View user's profile Send private message
warp5
Intermediate


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

PostPosted: Fri Jun 20, 2003 2:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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