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

Calling more than one subprograms


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guruji
Warnings : 1

New User


Joined: 13 Apr 2007
Posts: 59
Location: Chennai

PostPosted: Wed Aug 13, 2008 4:59 pm
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: 691
Location: Earth

PostPosted: Wed Aug 13, 2008 5:18 pm
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: Chennai

PostPosted: Wed Aug 13, 2008 5:24 pm
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts Calling IEHPROGM from REXX CLIST & REXX 7
Search our Forums:

Back to Top