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
 

 

Data passing using DFHCOMMAREA

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Data passing using DFHCOMMAREA
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Thu Aug 01, 2013 6:31 am    Post subject:
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    Post subject:
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    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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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