Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

query on commarea

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: query on commarea
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COMMAREA and CHANNELS menonkiran CICS 4 Tue Apr 04, 2017 8:14 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us