Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to create dynamic array in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jeyaraj

New User


Joined: 14 Nov 2005
Posts: 5

PostPosted: Thu Dec 15, 2005 11:24 am    Post subject: how to create dynamic array in cobol
Reply with quote

hi,
please tell me how to create dyanmic array in COBOl. using OCCURS clause with DEPENDING ON we can create only static arrays. Is there any possibility to create dynamic arrays in COBOL. Thanks in advance.
Back to top
View user's profile Send private message

iknow

Active User


Joined: 22 Aug 2005
Posts: 413
Location: Colarado, US

PostPosted: Thu Dec 15, 2005 12:07 pm    Post subject: Re: how to create dynamic array in cobol
Reply with quote

Hi Jeyaraj,

Not in the sense you, as a BASIC-language programmer, would understand 'dynamic array'.

The only way to do this in COBOL is to use a COBOL compiler which supports calls to the current operating system to do your own memory
allocation/reallocation/deallocation and then use POINTER data types to
access that data.

Yes, you could find some programmer to create the code needed, and structure it to resemble BASIC. But any such code will perforce be limited to a specific compiler on a specific target operating system.

Or, instead of using a 'memory' table/array, you could use a random-access file; see ORGANIZATION SEQUENTIAL ACCESS RANDOM RELATIVE KEY IS relative-key-name in your SELECT statements.


Hope this helps.
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Thu Dec 15, 2005 2:33 pm    Post subject: Re: how to create dynamic array in cobol
Reply with quote

hi,

The depending on works during run time. so if you know before submitting the job .. you pass number of occurences you need thru parm in jcl.

get parm parameter and move that value to depending on variable.

is that you are looking for or different
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us