View previous topic :: View next topic
|
Author |
Message |
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
WS-PAY-EXP-DATA is an array, occurs 900 times.
can i pass it like that??? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
come on!
I apologize for showing you a method, which in cobol II is a little obtuse.
in cobol ii you must have everything in linkage to perform a set.
that is why the third module.
looks like you will need a fourth.
one pgm which you call for pgm-b:
to set the ptr in B's linkage
to the address of the array defined in b's working-storage.
pgm-b CALLs pgm-c using ptr (defined in linkage) data-area (defined in W-S).
pgm-c using ptr data-area
set ptr to address of data-area
and one pgm which you call for pgm-a:
to set the address of the array defined in a's linkage
to the pointer in A's working-storage.
pgm-a CALLs pgm-d using ptr (defined in w-s) data-area (defined in linkage)
pgm-d using ptr data-area
set address of data-area to ptr
that is how you have to do it, to access a sub-modules data area.
sorry to have lead you to thinking that it would be easy. |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
Dick Brenholtz,
Thanks for the effort and time you spent. I understand that am bothering you soo much. I don't wanna bother you anymore.
Thanks again, I will look into it. |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
dick Brenholtz,
Its working, Thanks for your time.
I wrote four programs and is working fine. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I apologize for getting you involved with this,
but, now you have the basis
(the extra prgms to - set a pointer to the address of an area
- set the address of an area to a pointer)
to do this with new code.
Using pointers allows you silly stuff like this,
accessing sub-module working-storage,
but also,
if you have a little sub-system you have to write, are using dynamic calls,
you can define all the data areas in one module,
(to include any and all dclgened copybooks that can be used to transfer db2 data between modules)
load the address of each structure in a pointer
(define a structure that is passed in linkage that contains all the pointers)
then you CALL everybody using the same USING structure (the pointer list)
and each module addresses the data defined in linkage to the pointer. |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
Thanks for the info.
No issues, need not apologise.
Anyways we have achieved what I wanted.
Without your help I wouldn't have done this. You did a great help by directing me to build the solution. Thanks,.
“It is better to keep a friend from falling than to help him up”
Thanks again. |
|
Back to top |
|
|
|