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

query on commarea


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

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Fri Sep 09, 2005 8:47 am
Reply with quote

Hi friends

i need some clarification on restriction in using redefines with commarea

01 ws-commarea
05 field1 pic x(10)
05 field2 pic x(10)
05 field3 pic x(100)
05 field4 redefines field3


i called subprogram1 with field1, filed2,filled3( the data will be populated
into field3 by subprogram & it worked fine

But when i called subprogram2 with field1, filed2,filled4( the data will be populated
into field4 by subprogram..,the data is not populated

there is no error or abend at runtime or complile time

if if define them seperatly like
01 ws-commarea
05 area1
10 field1 pic x(10)
10 field2 pic x(10)
10 field3 pic x(100)

05 area2
10 field1 pic x(10)
10 field2 pic x(10)
10 field4 pic x(100)

and pass to subprograms..both are working fine

MY Query is CAN we use the redefines like the above

Regards
prasad
Back to top
View user's profile Send private message
mallikiran

New User


Joined: 07 Sep 2005
Posts: 49

PostPosted: Fri Sep 09, 2005 7:59 pm
Reply with quote

Internally, how data is passed using COMMAREA depends on whether you call your program using LINK or XCTL.

If you use LINK, then the COMMAREA is passed by reference, i.e. the address of the variable mentioned in COMMAREA(WS-XXX) is passed.

If you use XCTL, then the COMMAREA is passed by content, i.e. the entire COMMAREA is copied into a different storage area within CICS and this address is assigned to the COMMAREA in the called program. This is why LENGTH is a compulsary field when using COMMAREA with XCTL (as CICS needs to know how much data it should copy).

This is to explain how COMMAREA works.

About your question regarding redefines. There is no restriction about redefines because ultimately all CICS does is passes the address (if LINK is used) or copies the entire data content (if XCTL) is used.

If you are using XCTL and the data is not available in the called program, check if the data was available in the calling program in the first place. If it is, then check the LENGTH value you are using.

If you are using LINK, again check if the data was present in the calling program first. If it is, then there is no way that it is not available in the second program because both programs reference the same data area.
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 RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top