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

getting value for an array dynamically..


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pallavi_vibhute

New User


Joined: 04 Dec 2006
Posts: 4
Location: hyderabad

PostPosted: Fri Dec 08, 2006 10:10 am
Reply with quote

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

New User


Joined: 06 Dec 2006
Posts: 46
Location: Chennai

PostPosted: Fri Dec 08, 2006 8:15 pm
Reply with quote

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

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Sat Dec 09, 2006 1:29 am
Reply with quote

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

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Dec 09, 2006 2:41 am
Reply with quote

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Dec 09, 2006 9:17 pm
Reply with quote

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
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Dynamically pass table name to a sele... DB2 2
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts How to move values from single dimens... COBOL Programming 1
Search our Forums:

Back to Top