View previous topic :: View next topic
|
Author |
Message |
raviputran
New User
Joined: 05 Jul 2007 Posts: 13 Location: bangalore
|
|
|
|
Hi All,
I have a query about referencing a variable in COBOL-CICS environment.
Code:
01 VAR-1 PIC X(1).
01 VAR-5 PIC X(10).
SET ADDRESS OF VAR-1 TO ADDRESS OF DFHCOMMAREA.
CALL SUBPGM1 USING VAR-1 VAR-5
Which value of VAR-1 will be taken either its default value or the value contained in DFHCOMMAREA?
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
VAR-1 can only have one value at any given time. It has no "default" value.
Assuming that the absurdly-named VAR-1 is in the LINKAGE SECTION and that the code actually compiles, VAR-1 has the address of DFHCOMMAREA.
What is your actual question behind this? |
|
Back to top |
|
|
raviputran
New User
Joined: 05 Jul 2007 Posts: 13 Location: bangalore
|
|
|
|
Hi Bill,
Thanks for the reply. You are right. VAR-1 is in linkage section. Forgot to mention that.
If VAR-1 already has a value from the calling program and in the called program it is made to point the address of DFHCOMMAREA.
If we call a subprogram SUBPRG1 using VAR-1 what value will be passed to SUBPRG1?
Thanks |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
What happened when you did a test and put a display for VAR-1?
Regards,
Chandan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
What happened when you did a test and put a display for VAR-1? |
what a silly question
why test when it is faster to ask on a forum ? |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi Enrico,
I undestand what you meant to say by silly question
I hope raviputran also get it understood
Regards,
Chandan |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
raviputran,
DFHCOMMAREA PIC (something) defined somewhere
Program CICSA
stupid-dumb-name PIC (something else, though could be the same) defined somewhere else
CALL "CICSB" USING USING stupid-dumb-name
Program CICSB USING a-dumb-name-in-LINKAGE-SECTION.
So, a-dumb-name-in-LINKAGE-SECTION has the address of stupid-dumb-name passed to it by CICSA.
SET ADDRESS OF a-dumb-name-in-LINKAGE-SECTION
TO ADDRESS OF DFHCOMMAREA
Now it doesn't.
Does that answer your question? |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
If these are CICS programs then why are you doing CALLS ??? instead of XCTL or START, it this is a subroutine then a LINK. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Mickeydusaor,
May be because of below probable valid reasons.
1. CALL gives a better performance over LINK. The reason being CALL executes in the same run unit of the main program, wehre as LINK runs in a separate run unit.
2. CALL can be used to transfer more than 32K between the calling and called programs.
3. CALL can transfer multiple data elements, where as LINK can transfer only one. (DFHCOMMAREA) |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If the OP is dead-set on using LINK and/or XCTL API's and has a large amount of data, take at look at CHANNELS and CONTAINERS (introduced with CICS/TS 3.1), which allows usage of greater than 32763 of commarea-storage. You can also use CHANNELS and CONTAINERS for remote access with LINK API's. CALLED sub-programs can only be accessed locally within their own region.
HTH.... |
|
Back to top |
|
|
|