View previous topic :: View next topic
|
Author |
Message |
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
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 |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
guruji Warnings : 1 New User
Joined: 13 Apr 2007 Posts: 59 Location: Chennai
|
|
|
|
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 |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
PROCEDURE DIVISION USING LINK-DATA1 LINK-DATA2.
You don't code this in a CICS program. |
|
Back to top |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
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 |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
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 |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
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 |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
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 |
|
|
|