View previous topic :: View next topic
|
Author |
Message |
varunraisharma
New User
Joined: 01 Sep 2005 Posts: 15 Location: Bangalore
|
|
|
|
Can we pass arrays in linkage section???
Please give the reasons also... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
varunraisharma
New User
Joined: 01 Sep 2005 Posts: 15 Location: Bangalore
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
|