Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

getting value for an array dynamically..

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: getting value for an array dynamically..
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    Post subject:
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

Active Member


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

PostPosted: Sat Dec 09, 2006 1:29 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Sat Dec 09, 2006 2:41 am    Post subject: Re: getting value for an array dynamically..
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Changing UID dynamically in ACF2 newroad CA Products 2 Sat Oct 31, 2015 1:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us