Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: question about dynamic array
"Roby66" <NOSPAM@libero.it> wrote in message
news:d7kco0$pl$1@newsreader.mailgate.org...
> I thought I only need to change INDEX-VALUE to change array dimension

Changing INDEX-VALUE will change the maximum subscript you may access, but
the table (that's what BASIC arrays are usually called by COBOL programmers)
may never have more than 'max' elements as specified in the "OCCURS  min to
max"  clause; e.g.,

>   02 TAB01 OCCURS 1 TO 3 TIMES DEPENDING ON INDEX-VALUE.

You may never have more than three valid elements in this table.

MCM




Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
06-02-05 01:55 AM


Re: question about dynamic array

>
>You may never have more than three valid elements in this table.
>

Is there another way to use dynamic array in cobol ?
Or this force to me to declare statically an array ?

Roby

Report this thread to moderator Post Follow-up to this message
Old Post
Roby66
06-02-05 01:55 AM


Re: question about dynamic array
"Roby66" <NOSPAM@libero.it> wrote in message
news:d7kdvu$2pg$1@newsreader.mailgate.org...
> 
>
> Is there another way to use dynamic array in cobol ?
> Or this force to me to declare statically an array ?

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.


--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@talsystems.com
(long-time BASIC language programmer)






Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
06-02-05 01:55 AM


Re: question about dynamic array

>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.

Yes, right, seems to be the best solution.
Anyway I have to port this vb application on mainframe.
At the moment I don't know anything about it.
I only know new application has to be developed
using cobol II, I think cobol 85.
Customer sent me a source code is running on
their system and I suppose is standard ansi85.

Last question, If I use temp indexed files, how can I removed them
at the end of processing ?


Report this thread to moderator Post Follow-up to this message
Old Post
Roby66
06-02-05 01:55 AM


Re: question about dynamic array
"Michael Mattias" <michael.mattias@gte.net> wrote in message
news:j8jne.9438$iA6.9337@newssvr19.news.prodigy.com...

> 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.

Not in *standard* COBOL (though this, or close variations of this, is a
common extension).

The only ACCESS MODE allowed for ORGANIZATION SEQUENTIAL files in standard
'74, '85 or '02 COBOL is SEQUENTIAL.  See ANSI X3.23-1974 page IV-4, ANSI
X3.23-1985 page VII-7, and ISO/IEC 1989:2002 page 212 for the applicable
syntax diagrams.

However, you could substitute ORGANIZATION RELATIVE for ORGANIZATION
SEQUENTIAL into the above syntax and come up with standard COBOL.

-Chuck Stevens



Report this thread to moderator Post Follow-up to this message
Old Post
Chuck Stevens
06-02-05 01:55 AM


Re: question about dynamic array
If you are talking about "VS COBOL II" on an IBM mainframe, you should know 
that
compiler is out-of-service and has been for many years.  The currently suppo
rted
IBM compiler (that does include the '85 Standard *PLUS* intrinsic functions
*PLUS* Object orientation PLUS lots of extensions) is "Enterprise COBOL". Yo
u
will need to find out exactly which compiler is your target - to know what y
ou
can and cannot code.

--
Bill Klein
wmklein <at> ix.netcom.com
"Roby66" <NOSPAM@libero.it> wrote in message
news:d7kg5b$2pg$2@newsreader.mailgate.org...
>
> 
>
> Yes, right, seems to be the best solution.
> Anyway I have to port this vb application on mainframe.
> At the moment I don't know anything about it.
> I only know new application has to be developed
> using cobol II, I think cobol 85.
> Customer sent me a source code is running on
> their system and I suppose is standard ansi85.
>
> Last question, If I use temp indexed files, how can I removed them
> at the end of processing ?
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
06-02-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:40 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.