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

Declare a array/table(using occurs class) in the linkage sec


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon May 31, 2010 3:15 pm
Reply with quote

WS-PAY-EXP-DATA is an array, occurs 900 times.
can i pass it like that???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 31, 2010 3:36 pm
Reply with quote

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

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon May 31, 2010 3:43 pm
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon May 31, 2010 6:05 pm
Reply with quote

dick Brenholtz,

Its working, Thanks for your time.
I wrote four programs and is working fine.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 31, 2010 6:46 pm
Reply with quote

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

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jun 01, 2010 10:24 am
Reply with quote

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” icon_smile.gif

Thanks again.
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 -> COBOL Programming Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top