|
From: Pete Dashwood on 2 Jul 2008 20:05 I was told that RM COBOL cannot randomly access an ISAM file using a secondary key, with READ... KEY IS. Instead, it is necessary to use a START on the secondary key, then issue a READ NEXT. This seems like such a violation of the standard (and so grossly inefficient...) that I wondered if anyone using RM COBOL might confirm, deny or comment on it? (It has some important impacts when converting to RDB...) Pete. -- "I used to write COBOL...now I can do anything."
From: James J. Gavan on 2 Jul 2008 23:04 Pete Dashwood wrote: > I was told that RM COBOL cannot randomly access an ISAM file using a > secondary key, with READ... KEY IS. > > Instead, it is necessary to use a START on the secondary key, then issue a > READ NEXT. > > This seems like such a violation of the standard (and so grossly > inefficient...) that I wondered if anyone using RM COBOL might confirm, deny > or comment on it? > > (It has some important impacts when converting to RDB...) > > Pete. Methinks, somebody is feeding you a load of guff ! ---------------------------------------------------------- The Indexed File Control Entry : --------------------------------- SELECT file-name ASSIGN TO RANDOM ("external-file-name") (data-name-1) RESERVE integer(AREA/AREAS) ORGANIZATION is INDEXED ACCESS MODE IS (SEQUENTIAL/RANDOM/DYNAMIC) RECORD KEY IS data-name-2 ALTERNATE RECORD KEY IS data-name-3 (WITH DUPLICATES) OR 'without' FILE STATUS is data-name-4 Check Liant on-line manuals to expand on a definition of data-names 2 and 3 ISAM READ : The READ Statement (Relative and Indexed I/O) --------------------------------------------------------- Format 1 : READ file-name (NEXT) RECORD (WITH NO LOCK) (INTO identifier) AT END imperative-statement) Format 2 : READ file-name RECORD (WITH NO LOCK) (INTO identifier) KEY IS data-name INVALID KEY imperative-statement Format 1 is used for files in sequential access mode. Format 2 is used for files in random access mode or for files in dynamic access mode; I always specified 'Dynamic' for my ISAMs. The KEY phrase may be specified only when the organization is 'ISAM'. When the KEY clause is present, data-name must be the name of one of the record keys associated with file-name. Data-name may be qualified. Obviously more than above - but check out latest Liant manuals; they are up to Version 11 I believe. ----------------------------------------------------------------------- Your informant had better take an RM Refresher Course. The extract I've given above is from Version 2.0b, obsolete and no longer supported and published in 1984 - so that makes it COBOL '78 ? Jimmy
From: Richard on 3 Jul 2008 00:37 On Jul 3, 12:05 pm, "Pete Dashwood" <dashw...(a)removethis.enternet.co.nz> wrote: > I was told that RM COBOL cannot randomly access an ISAM file using a > secondary key, with READ... KEY IS. There is a problem if duplicates are allowed as it will not be possible to access every record using this. Perhaps he was talking about a specific file or situation. > Instead, it is necessary to use a START on the secondary key, then issue a > READ NEXT. It may well be necessary to use this, or a READ followed by READ NEXT until key changes, if duplicates are allowed. > This seems like such a violation of the standard (and so grossly > inefficient...) that I wondered if anyone using RM COBOL might confirm, deny > or comment on it? > (It has some important impacts when converting to RDB...)
From: Pete Dashwood on 3 Jul 2008 06:29 "James J. Gavan" <jgavandeletethis(a)shaw.ca> wrote in message news:PkXak.48262$kx.3296(a)pd7urf3no... > Pete Dashwood wrote: >> I was told that RM COBOL cannot randomly access an ISAM file using a >> secondary key, with READ... KEY IS. >> >> Instead, it is necessary to use a START on the secondary key, then issue >> a READ NEXT. >> >> This seems like such a violation of the standard (and so grossly >> inefficient...) that I wondered if anyone using RM COBOL might confirm, >> deny or comment on it? >> >> (It has some important impacts when converting to RDB...) >> >> Pete. > > Methinks, somebody is feeding you a load of guff ! > Thanks, Jimmy, that was my feeling too. I did a quick search for Liant manuals online but couldn't find much. Cheers, Pete. <snip>
From: Pete Dashwood on 3 Jul 2008 06:39 "Richard" <riplin(a)azonic.co.nz> wrote in message news:a0e6fe4c-8340-4bfb-9a81-2f7dc599038d(a)a9g2000prl.googlegroups.com... On Jul 3, 12:05 pm, "Pete Dashwood" <dashw...(a)removethis.enternet.co.nz> wrote: > I was told that RM COBOL cannot randomly access an ISAM file using a > secondary key, with READ... KEY IS. There is a problem if duplicates are allowed as it will not be possible to access every record using this. Perhaps he was talking about a specific file or situation. [Pete] Thanks Richard. I think they tend to use duplicates with their secondary indexes so that may be where it came from. Is this a known bug? Certainly Fujitsu allow access on a secondary key without using START, even if duplicates are permitted. I see your point that it isn't possible to know WHICH duplicate will be returned, but, as far as I know the COBOL standard also allows this. [/Pete} > Instead, it is necessary to use a START on the secondary key, then issue a > READ NEXT. It may well be necessary to use this, or a READ followed by READ NEXT until key changes, if duplicates are allowed. [Pete] Yes, I see what you're saying. [/Pete] > This seems like such a violation of the standard (and so grossly > inefficient...) that I wondered if anyone using RM COBOL might confirm, > deny > or comment on it? > (It has some important impacts when converting to RDB...) [Pete] Given your points above, I guess it makes sense. Thanks for this. Pete. -- "I used to write COBOL...now I can do anything."
|
Pages: 1 Prev: arcsinus Next: RM COBOL Question (by Pete Dashwood dashwood@removethis.enternet.co.nz) |