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: Sort registers
"JerryMouse" <nospam@bisusa.com> wrote in message
news:obKdnZ4-bN3U6dvdRVn-jw@giganews.com...
> Hey, I'm easy.
>
> How would you add a record to an ISAM file such that when the file is
later
> read sequentially the latest date is the first record returned?

You do not read indexed files sequentially. You can read them in key order
if you want; you can even use ACCESS DYNAMIC to allow the use of the START
and READ NEXT verbs to read in key order starting somewhere other than at
the beginning.

But as far as adding records so that when you do choose to read in key order
they come out in the order you want? That has nothing to do with file access
per se; that is totally a function of the way you build the key and/or the
way the ISAM manager allows you to define those keys.

MCM




Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
03-27-04 03:59 AM


Re: Sort registers
Michael Mattias wrote:
> "JerryMouse" <nospam@bisusa.com> wrote in message
> news:obKdnZ4-bN3U6dvdRVn-jw@giganews.com... 
>
> You do not read indexed files sequentially. You can read them in key
> order if you want; you can even use ACCESS DYNAMIC to allow the use
> of the START and READ NEXT verbs to read in key order starting
> somewhere other than at the beginning.

Thanks for the update.

I've erased all instances of

ACCESS IS SEQUENTIAL

in my COBOL manuals where it appears in conjunction with ISAM files.



Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
03-27-04 03:59 AM


Re: Sort registers
Xref: kermit comp.lang.cobol:85798

In article <xYF1c.30290$PY.10697@newssvr26.news.prodigy.com>,
Michael Mattias <michael.mattias@gte.net> wrote:
>"JerryMouse" <nospam@bisusa.com> wrote in message
>news:obKdnZ4-bN3U6dvdRVn-jw@giganews.com... 
>
>You do not read indexed files sequentially. You can read them in key order
>if you want; you can even use ACCESS DYNAMIC to allow the use of the START
>and READ NEXT verbs to read in key order starting somewhere other than at
>the beginning.

This is confusing, Mr Mattias... how are you making 'in key order' to be
something other than 'in key order sequence'?

DD


Report this thread to moderator Post Follow-up to this message
Old Post
docdwarf@panix.com
03-27-04 03:59 AM


Re: Sort registers
I've clearly caused some confusion here.

It "appears" the OP thought the "sequence order" and/or "PHYSICAL
construction" of the keys associated with a key-sequenced ("isam")  file are
under the direct control of the COBOL language.

Of course, COBOL of and by itself has nothing to to with these things: COBOL
deals only with the LOGICAL construction of keys and order of retrieval.

Probably just should have said that the first time....

MCM

<docdwarf@panix.com> wrote in message news:c27cjf$rp3$1@panix5.panix.com...
> In article <xYF1c.30290$PY.10697@newssvr26.news.prodigy.com>,
> Michael Mattias <michael.mattias@gte.net> wrote: 
later 
order 
START 
>
> This is confusing, Mr Mattias... how are you making 'in key order' to be
> something other than 'in key order sequence'?
>
> DD
>



Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
03-27-04 03:59 AM


Re: Sort registers
"JerryMouse" <nospam@bisusa.com> wrote

> Michael Mattias wrote:
 
>
> Thanks for the update.
>
> I've erased all instances of
>
>    ACCESS IS SEQUENTIAL
>
> in my COBOL manuals where it appears in conjunction with ISAM files.

You should ignore that comment from MM.  ACCESS SEQUENTIAL and READ ..
AT END .. gives identical results to ACCESS DYNAMIC and READ ... NEXT
RECORD AT END ..

Both of these give the records in key sequence order, and are 'reading
the indexed file sequentially'.

START _can_ be used on a file with ACCESS SEQUENTIAL and it does not
need to be DYNAMIC for this.

What DYNAMIC does is allow a RANDOM READ to be done on the file in
addition to allowing the file to be read sequentially.  A random read
is one in which the key value in the record is set and a READ
statement without NEXT or AT END is done.  I  always use READ .. NEXT
RECORD when doing a sequential read on a file that has ACCESS DYNAMIC,
it clarifies the difference.

Both SEQUENTIAL and DYNAMIC are useful.

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
03-27-04 03:59 AM


Re: Sort registers
"JerryMouse" <nospam@bisusa.com> wrote

> How would you add a record to an ISAM file such that when the file is late
r
> read sequentially the latest date is the first record returned?
>
> OPEN INPUT filename REVERSED?


START ... FIRST KEY ... REVERSED
READ ... PREVIOUS RECORD ..

This works for the whole key size, what was actually required was
parts to be ascending and other parts descending which can only be
done by setting appropriate values in the key.

Report this thread to moderator Post Follow-up to this message
Old Post
Richard
03-27-04 03:59 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:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.