View previous topic :: View next topic
|
Author |
Message |
pallavi_vibhute
New User
Joined: 04 Dec 2006 Posts: 4 Location: hyderabad
|
|
|
|
Hi all,
I just completed my Mainframe training & faced one interview & que asked to me & cudnt reply was -
How do you get the value for an array dynamically without hard coding in the program or either passing from JCL?
will anybody tell me the answer ....
thanks in advance,
regards pallavi. |
|
Back to top |
|
|
h.dinesh
New User
Joined: 06 Dec 2006 Posts: 46 Location: Chennai
|
|
|
|
Pallavi,
I think they have asked about 'OCCURS...DEPENDING ON' clause here.
You may find more details about this clause by searching the text in quotes. I am not mentioning the links here as it might violate copyright.
All,
Please correct me if this is not the answer.
Dinesh |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
It certainly depends on the language.
PL/I allows dynamic allocation with variables.
Later versions of FORTRAN do as well.
SAS lets you do it with macros.
COBOL does not have that feature. The DEPENDING ON clause does not replace the need in the OCCURS for a fixed upper bound. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
pallavi_vibhute wrote: |
get the value for an array dynamically |
While I still don't understand what is being looked for,
Phrzby Phil wrote: |
COBOL does not have that feature. The DEPENDING ON clause does not replace the need in the OCCURS for a fixed upper bound |
got me thinking, and up to the bounds of maximum allowed by COBOL, define the array in linkage and getmain all the storage you need.....eat that PL/I, FORTRAN and SAS... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Pallavi,
I'm not sure of what you're looking for, but you can set up a routine to read the array entries from a file or some other external source, keeping count of the enries put into the array space and then moving that value to the "depending on" field. HTH |
|
Back to top |
|
|
|