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

Data passing using DFHCOMMAREA


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

New User


Joined: 13 Dec 2007
Posts: 14
Location: india

PostPosted: Thu Aug 01, 2013 12:50 am
Reply with quote

Hi ALL,

in my shop. I saw coding as
PGMA
|
|
EXEC CICS
XCTL program (WS-PGMB)
COMMAREA(DFHCOMMAREA)
LENGTH(LENGTH of DFHCOMMAREA)
END-EXEC.
|
|
Now PGMB does some processing, send a MAP on the terminal and receive some data and issue XCTL to PGMC

EXEC CICS
XCTL program (WS-PGMC)
COMMAREA(DFHCOMMAREA)
LENGTH(LENGTH of DFHCOMMAREA)
END-EXEC.
|
|

Now in PGMC it just checks few things in DFHCOMMAREA and issue XCTL to PGMA

XEC CICS
XCTL program (WS-PGMA)
COMMAREA(DFHCOMMAREA)
LENGTH(LENGTH of DFHCOMMAREA)
END-EXEC.

Now I’ll be on the same screen from where I started

When I saw the structure of the DFHCOMMAREA for all three programs (PGMA, PGMB and PGC) they all are having different variable names in DFHCOMMAREA with different PIC (but overall length of DFHCOMMAREA is same which is 700 character)

DFHCOMMAREA has been defined as below in all three programs;
in PGMA
01 DFHCOMMAREA
02 AAAA PIC X(6)
|
|

in PGMB
01 DFHCOMMAREA
02 BBBB PIC X(6)
|
|

in PGMC
01 DFHCOMMAREA
02 CCCC PIC X(6)
|
|


So my questions are;

1. Does is it mean AAAA will be passed to BBBB? BBBB will be passed to CCCC and again CCCC will be passed to AAAA?
2. when control passed using XCTL then in the LINKAGE SECTION the data mapping will be one to one corresponding or not ?
3. If yes then who takes care of the addressability of variables under DFHCOMMAREA and ensure that AAAA will go to BBBB?

please let me know in case you need more inputs.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 01, 2013 6:31 am
Reply with quote

You completely misunderstand storage. AAAA, BBBB, CCCC all refer to the same bytes of storage -- there is nothing being passed between programs about variable names. Think of the data as BBBB redefining AAAA and CCCC redefining BBBB -- that is closer to what is actually happening.

Learn this well: THERE IS NO CORRESPONDENCE, IN EITHER NUMBER OR DATA TYPE, BETWEEN THE CALLING PROGRAM VARIABLES OF DFHCOMMAREA AND THE CALLED PROGRAM VARIABLES OF DFHCOMMAREA. Program A could have
Code:
01  DFHCOMMAREA.
    05  AAAA PIC S9(07) COMP-3.
while program B has
Code:
01  DFHCOMMAREA.
    05  BBBB PIC S9(08) COMP-5.
and Program C has
Code:
01  DFHCOMMAREA.
05  CCCC OCCURS 4 PIC X(01).
There is nothing wrong about such definitions -- and there may well be cases where such data would be passed between the programs. Program B variable BBBB refers to the same memory as program A variable AAAA -- even though A defines the data as packed decimal and B defines it as binary. Program C refers to the same 4 bytes as 4 separate bytes labelled CCCC -- and this is still valid and allowed.

As long as the length of the DFHCOMMAREA is not exceeded, program B may not use or even reference all the memory locations for the variables passed by program A.
Back to top
View user's profile Send private message
sachinji84

New User


Joined: 13 Dec 2007
Posts: 14
Location: india

PostPosted: Sat Aug 03, 2013 11:25 pm
Reply with quote

Thank you very much,
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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top