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

Data not getting passed from sub pgm to main pgm


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

Global Moderator


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

PostPosted: Tue Mar 05, 2013 5:37 am
Reply with quote

Quote:
I am wondering whether it is because PROG B is declared as online eventhough it doesn't contain any CICS statements.(I am not sure).
I've not heard of this being an issue before.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 05, 2013 6:17 am
Reply with quote

Are you showing the PROCEDURE DIVISION USING ... from the source programs or the compile listings? Can you check the listings please?
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Tue Mar 05, 2013 10:16 am
Reply with quote

Bill,

Please see the PROCEDURE DIVISION USING that is used in the modules

PROGRAM A

Code:
WORKING STORAGE SECTION.
05  WS-DUMMY-DFHCOMMAREA PIC X          VALUE SPACES.
05  WS-TEST-DATA                   PIC X(100).

PROCEDURE DIVISION.

CALL PROGRAM-B USING DFHEIBLK
      WS-DUMMY-DFHCOMMAREA
      WS-TEST-DATA


PROGRAM B

Code:
WORKING STORAGE SECTION
01 WS-TEST-DATA               PIC X(100).

LINKAGE SECTION.
01  DFHCOMMAREA                     PIC X(01).
01  LS-TEST-DATA                      PIC X(100).

PROCEDURE DIVISION USING DFHEIBLK
                         DFHCOMMAREA
                         LS-TEST-DATA
<processes data and calls Program C and control comes back here>
GOBACK

Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Tue Mar 05, 2013 7:49 pm
Reply with quote

Good day to all!

Vinu78, make your WS-TEST-DATA a LINKAGE SECTION variable in PROG A. Remember that WORKING-STORAGE variable could be pass to PROG B but if PROG B manipulate those variable it is done in B and not in A. I am confuse why are you using WS-DUMMY-DFHCOMMAREA I some cases then DFHCOMMAREA in others.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 05, 2013 8:49 pm
Reply with quote

Jose,

If the PROGA field is in Linkage, where does the storage for it come from?

What do you mean if the manipulations are done in PROGB it only affects PROGB, not PROGA?

The "name" of something does not matter. It is that USINGS "line up" with the data that is being expected.

Vinu78,

How do you get ????? for the DISPLAY of the packed-decimal? Is this output from a DISPLAY, or from a debugger or something?
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Tue Mar 05, 2013 9:11 pm
Reply with quote

Bill,

I got ???? from Expeditor (online debugger since it is executed online).

I am getting the values to WS-TEST-DATA through MQ queue in PROG A and once these variables has the value, we are calling PROG B for re-formatting and writing to online VSAM file. So WS-TEST-DATA is declared in Working storage section in PROG A (and not in Linkage section as we don't have to). However it is declared in Linkage section (as LS-) as well as in Work storage section in PROG B, since the values are passed from PROG A.

Interesting thing is, if I am passing the Sequence number separately as WS-SEQ-NO as one one of the calling parameter (apart from WS-TEST-DATA) from PROG A to PROG B, and then increment the Seq number value in PROG B, this new Seq value stays intact even if the control comes back to PROG A.
I am not sure what is happening behind the scenes.

Thanks
Vinu


Thanks
Chidam
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: Tue Mar 05, 2013 9:13 pm
Reply with quote

To expand upon Bill's comment, the USING phrases must line up, and the type of call (BY REFERENCE, BY CONTENT, BY VALUE) can impact the results especially when passing data back from the calling program.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Tue Mar 05, 2013 9:39 pm
Reply with quote

Bill,
From what I see is that WS-TEST-DATA is defined as a WORKING-STORAGE variable in PROG A which is been pass to PROG B by a call and it is defined in a LINKAGE SECTION in PROG B. In PROG B it calculates a sequence number which is part of WS-TEST-DATA but because there's no linkage storage between PROG A and PROG B, PROG A doesn't have the modified sequence number from PROG B.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Mar 05, 2013 10:07 pm
Reply with quote

But the linkage section does not include those variables that are defined (and for which storage is allocated) in the module, correct? So no linkage section ought to be included in program A, only the variable definitions; if the arguments are passed by reference, the variables will be updated by activity in program B.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 05, 2013 10:25 pm
Reply with quote

Vinu,

Can you post the compile options of the modules, separately if they are different.

What is the actual output from the DISPLAY in PROGA after the CALL to PROGB (regardless of what you get from the debugger).

Can you also include your CICS version, MQ version.
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Tue Mar 05, 2013 10:30 pm
Reply with quote

I am thinking whether DFHCOMMAREA and DFHEIBLK plays the role here.
Whether we need to have DFHCOMMAREA and DFHEIBLK to be declared in PROG-B ? Because if we declare something like this in PROG-A, we are not losing the value from WS-SEQ-NO once the control comes back from PROG B to A

Code:
CALL PROG-B USING DFHEIBLK             
                               WS-DUMMY-DFHCOMMAREA 
                               WS-TEST-DATA
                               WS-SEQ-NUM   


In PROG B, I have declared as

Code:
LINKAGE SECTION.                               
01  DFHCOMMAREA                     PIC X(01). 
01  LS-TEST-DATA                   PIC X(100).
01  LS-SEQ-NUM                       PIC S9(5) COMP-3.

PROCEDURE DIVISION USING DFHEIBLK             
                         WS-DUMMY-DFHCOMMAREA 
                         LS-TEST-DATA             
                         LS-SEQ-NUM     
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Mar 05, 2013 10:43 pm
Reply with quote

vinu78 wrote:
I am thinking whether DFHCOMMAREA and DFHEIBLK plays the role here.
Whether we need to have DFHCOMMAREA and DFHEIBLK to be declared in PROG-B ? Because if we declare something like this in PROG-A, we are not losing the value from WS-SEQ-NO once the control comes back from PROG B to A
Hope this link helps you with your query...
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 179
Location: India

PostPosted: Mon Mar 11, 2013 9:13 pm
Reply with quote

Thanks everybody for the inputs and suggestions.
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
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
Search our Forums:

Back to Top