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

Can we pass arrays in linkage section???


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

New User


Joined: 01 Sep 2005
Posts: 15
Location: Bangalore

PostPosted: Tue Sep 13, 2005 6:19 pm
Reply with quote

Can we pass arrays in linkage section???

Please give the reasons also...
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Sep 14, 2005 5:30 am
Reply with quote

Sure. An array is just a clump of data like any other. It's the data def that makes it special. For example;

05 clump pic x(100).
05 array redefines clump.
10 array-entry occurs 50 times pic x(002).

call 'subpgm' using clump
or
call 'subpgm' using array

it's still just 100 bytes of data.

Admittedly, I've never tried "call 'subpgm' using array", but it's just a string of 100 bytes even if you indexed it.
Back to top
View user's profile Send private message
varunraisharma

New User


Joined: 01 Sep 2005
Posts: 15
Location: Bangalore

PostPosted: Wed Sep 14, 2005 9:21 am
Reply with quote

Thanks

But actually i m confused on one point.

We can surely not pass index in the linkage section as its not a working storage variable in the calling program. So what if we try to pass an array
referenced by an index and not subscript.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Sep 16, 2005 5:31 am
Reply with quote

I don't know what you're trying to accomplish, but the index (or the SS for that matter) is just a pointer into the table (the clump of data). You can define an identical table in the WS of the sub pgm and move the passed data (the clump) into it. Then do your thing.

Better yet, use a SS to access it and you won't even have to move it.

Maybe you should explain what you want to accomplish by passing the table. If you just want to search it, just do what I suggested above.
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

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Advice on Arrays PL/I & Assembler 10
Search our Forums:

Back to Top