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
 

 

Calling more than one subprograms

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

New User


Joined: 13 Apr 2007
Posts: 59
Location: Bangalore

PostPosted: Wed Aug 13, 2008 4:59 pm    Post subject: Calling more than one subprograms
Reply with quote

Hi,

If a Cobol program calls more than one subprogram, shall we code two linkage sections?
And shall we pass two linkage data when coding "PROCEDURE DIVISION USING"

Please revert back on the same.
Thanx,
Reni
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Aug 13, 2008 5:18 pm    Post subject:
Reply with quote

Could you please explain your question a bit? It totally confused me. Please tell what are you trying to achieve.
There can not be more than 1 LINKAGE SECTION.
Back to top
View user's profile Send private message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Bangalore

PostPosted: Wed Aug 13, 2008 5:24 pm    Post subject:
Reply with quote

Actually, I did not mean two linkage sections. Sorry for the same.
I meant two linkage parameters, for two different subprograms.like:

01 LINK-DATA1.
05.......
.......

01 LINK-DATA2.
05......
......

I wanted to know if I can code like above. And if I can cal the procedure division like below.
PROCEDURE DIVISION USING LINK-DATA1 LINK-DATA2.

thanks
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Aug 13, 2008 6:24 pm    Post subject:
Reply with quote

PROCEDURE DIVISION USING LINK-DATA1 LINK-DATA2.


You don't code this in a CICS program.
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Thu Aug 14, 2008 12:35 pm    Post subject: Reply to: Calling more than one subprograms
Reply with quote

Guruji,

I reckon we all are little confused.
I am stating a scenario, please see if it is in sync with your requirement.

Program A calls Program B and Program C
U have defined memory structure in

01 link1-2-B
05...

01 link-2-C
05...

So from your program A you have to call B and C ...one after the other(depends on th logic of ur program)
CALL 'B' using link1-2-B
After u get your control back from B
CALL 'C' using link1-2-C

You cannot call them at same time.

Moreover the linkage section of program A is not dependent on the programs it is calling but from the program it has been called.

I hope this helps.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Aug 14, 2008 6:45 pm    Post subject:
Reply with quote

With CICS, you can not use the linkage section of a calling program
for what Christoper describes. UNLESS, you first perform CICS getmains
for areas link1-2-B and link-1-2-C and then establish addressability.


Reni,

please explain in more detail what you are trying to accomplish.
Back to top
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Tue Aug 19, 2008 5:33 pm    Post subject: Reply to: Calling more than one subprograms
Reply with quote

Earl , as i have stated in my previous POST that linkage section of the CALLED programs and not the CALLING programs.

As per my understanding the concept of CICS GETMAIN is simply to provide the programmer the capacity of obtaining additional storage to augment storage acquired automatically by his program (e.g., WORKING-STORAGE in a COBOL program). The programmer may define certain fields (01 Levels) in the LINKAGE SECTION that may require the use of a GETMAIN to obtain the storage. These fields are usually output fields that are not passed to the program by another program (caller). In the case of input fields, the use of the SET can be used to point to the acquired area or a calling program can pass the address to the called program.

Why do we need to do GETMAIN over here?For what do we need to retrieve memory for when we our selves creating memory structure to call the programs?
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Tue Aug 19, 2008 7:07 pm    Post subject:
Reply with quote

Christopher,

My statement regarding getmains, is only 1 of several ways for establishing addressability to linkage section area.

I was only trying to point out that you need to establish addressability
to these areas before you should reference them.


FYI: I have been coding in CICS for almost 40 years, coding
both Macro level and command level programs (COBOL and Assembler), so I am well aware of how to use the the linkage section.
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts "DFSRRC00 vs IKJEFT01" for ... arunsoods All Other Mainframe Topics 5 Fri Aug 12, 2016 9:54 pm
No new posts How to get the program name of callin... pkmurali COBOL Programming 8 Mon Aug 01, 2016 3:36 am
No new posts Calling Cobol DB2 program from a cobo... nkjain87 DB2 2 Thu Jul 21, 2016 5:12 pm
No new posts Calling macro via rexx in batch mode. SanaR CLIST & REXX 15 Tue Mar 08, 2016 4:46 pm


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