Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reference of a variable in COBOL-CICS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
raviputran

New User


Joined: 05 Jul 2007
Posts: 13
Location: bangalore

PostPosted: Tue Sep 09, 2014 12:37 pm    Post subject: Reference of a variable in COBOL-CICS
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Sep 09, 2014 1:16 pm    Post subject: Reply to: Reference of a variable in COBOL-CICS
Reply with quote

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
View user's profile Send private message
raviputran

New User


Joined: 05 Jul 2007
Posts: 13
Location: bangalore

PostPosted: Tue Sep 09, 2014 1:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 271
Location: Mumbai

PostPosted: Tue Sep 09, 2014 5:09 pm    Post subject:
Reply with quote

Hi,

What happened when you did a test and put a display for VAR-1?

Regards,
Chandan
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10487
Location: italy

PostPosted: Tue Sep 09, 2014 5:17 pm    Post subject: Reply to: Reference of a variable in COBOL-CICS
Reply with quote

Quote:
What happened when you did a test and put a display for VAR-1?


what a silly question icon_wink.gif

why test when it is faster to ask on a forum ?
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 271
Location: Mumbai

PostPosted: Wed Sep 10, 2014 12:43 pm    Post subject:
Reply with quote

Hi Enrico,

I undestand what you meant to say by silly question icon_wink.gif

I hope raviputran also get it understood icon_biggrin.gif

Regards,
Chandan
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Wed Sep 10, 2014 1:23 pm    Post subject: Reply to: Reference of a variable in COBOL-CICS
Reply with quote

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
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Sep 10, 2014 7:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1940
Location: NY,USA

PostPosted: Wed Sep 10, 2014 8:45 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Sep 10, 2014 9:27 pm    Post subject: Reply to: Reference of a variable in COBOL-CICS
Reply with quote

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
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 AFP duplex page containing variable data jose angel santamaria IBM Tools 0 Wed Jul 18, 2018 12:35 pm
No new posts Error while initiation CICS program f... Ashishpanpaliya CICS 3 Mon Jul 16, 2018 5:12 pm
No new posts SQL IN predicate using COBOL table jerryte DB2 16 Fri Jun 29, 2018 10:30 pm
No new posts Converting SAS code to Cobol or Easyt... Ashish.Raghav All Other Mainframe Topics 6 Fri Jun 29, 2018 6:01 pm
No new posts Can we use a file both as input and o... Chiku kumar COBOL Programming 11 Thu Jun 28, 2018 3:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us