Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Jesus may love you, but I think you're garbage wrapped in skin." -- Michael O'Donohugh


devel / comp.lang.cobol / Retrieve the 15 last records

SubjectAuthor
* Retrieve the 15 last recordsVolker Englisch
+* Re: Retrieve the 15 last recordsJoe
|`- Re: Retrieve the 15 last recordsVolker Englisch
+* Solved (was: Re: Retrieve the 15 last records)Volker Englisch
|`* Re: Solved (was: Re: Retrieve the 15 last records)Rick Smith
| `- Re: Solved (was: Re: Retrieve the 15 last records)docdwarf
`* Re: Retrieve the 15 last recordsVincent Coen
 +* Re: Retrieve the 15 last recordsJoe
 |+- Re: Retrieve the 15 last recordsbill
 |+* Re: Retrieve the 15 last recordsRick Smith
 ||`- Re: Retrieve the 15 last recordsVincent Coen
 |`* Re: Retrieve the 15 last recordsVincent Coen
 | `- Re: Retrieve the 15 last recordsdocdwarf
 `- Re: Retrieve the 15 last recordsVolker Englisch

1
Retrieve the 15 last records

<u83eke$2uks$1@selene.rsli.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=459&group=comp.lang.cobol#459

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!selene.inka.de!.POSTED.localhost!not-for-mail
From: eh41@selene.inka.de (Volker Englisch)
Newsgroups: comp.lang.cobol
Subject: Retrieve the 15 last records
Date: Wed, 5 Jul 2023 11:54:22 +0200
Organization: Rabbit System
Archive: no
Message-ID: <u83eke$2uks$1@selene.rsli.de>
Injection-Date: Wed, 5 Jul 2023 09:54:22 -0000 (UTC)
Injection-Info: selene.rsli.de; posting-host="localhost:127.0.0.1";
logging-data="96924"; mail-complaints-to="usenet@selene.inka.de"
User-Agent: slrn/0.9.7.4 (FreeBSD)
X-No-Archive: yes
 by: Volker Englisch - Wed, 5 Jul 2023 09:54 UTC

Hello all together!

I need to retrieve the last matching records from a serial file. I
tried it this way:

01 WS-LINES.
05 WS-LINE OCCURS 15 TIMES PIC X(40).

1000-LOOP.
READ DWB000
AT END ...
END-READ.
READ DWB000-RECORD.
IF WS-ARTNO IS EQUAL DWB000-ARTNO THEN
PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
END-PERFORM
MOVE DWB000-RECORD TO WS-LINE (15)
END-IF.
GO TO 1000-LOOP.

Finally I get 15 empty lines. My intention was to push the LINEs
downwards and move the currently found record into the highest line...

And idea why that doesn't work? Or, is there another approach to
accomplish it?

I'm working with GnuCobol on FreeBSD, if that's important.

TIA
Volker

Re: Retrieve the 15 last records

<3e4bai5gnlbq4n0lhj58li5i6dgjqlr0la@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=460&group=comp.lang.cobol#460

  copy link   Newsgroups: comp.lang.cobol
From: none@nowhere.whereo (Joe)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Wed, 05 Jul 2023 15:53:10 +0000
Reply-To: none@nowhere.whereo
Message-ID: <3e4bai5gnlbq4n0lhj58li5i6dgjqlr0la@4ax.com>
References: <u83eke$2uks$1@selene.rsli.de>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 36
Injection-Date: Wed, 05 Jul 2023 17:53:10 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1662
 by: Joe - Wed, 5 Jul 2023 15:53 UTC

On Wed, 5 Jul 2023 11:54:22 +0200, Volker Englisch <eh41@selene.inka.de> wrote:

>Hello all together!
>
>I need to retrieve the last matching records from a serial file. I
>tried it this way:
>
>01 WS-LINES.
> 05 WS-LINE OCCURS 15 TIMES PIC X(40).
>
>1000-LOOP.
> READ DWB000
> AT END ...
> END-READ.
> READ DWB000-RECORD.
> IF WS-ARTNO IS EQUAL DWB000-ARTNO THEN
> PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
> MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
> END-PERFORM
> MOVE DWB000-RECORD TO WS-LINE (15)
> END-IF.
> GO TO 1000-LOOP.
>
>Finally I get 15 empty lines. My intention was to push the LINEs
>downwards and move the currently found record into the highest line...
>
>And idea why that doesn't work? Or, is there another approach to
>accomplish it?
>
>I'm working with GnuCobol on FreeBSD, if that's important.
>
>TIA
>Volker
>
I would first SORT the file around & then read first 15 ;-)

Solved (was: Re: Retrieve the 15 last records)

<u843ql$9n1$1@selene.rsli.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=461&group=comp.lang.cobol#461

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!selene.inka.de!.POSTED.localhost!not-for-mail
From: eh41@selene.inka.de (Volker Englisch)
Newsgroups: comp.lang.cobol
Subject: Solved (was: Re: Retrieve the 15 last records)
Date: Wed, 5 Jul 2023 17:56:05 +0200
Organization: Rabbit System
Message-ID: <u843ql$9n1$1@selene.rsli.de>
References: <u83eke$2uks$1@selene.rsli.de>
Injection-Date: Wed, 5 Jul 2023 15:56:05 -0000 (UTC)
Injection-Info: selene.rsli.de; posting-host="localhost:127.0.0.1";
logging-data="9953"; mail-complaints-to="usenet@selene.inka.de"
User-Agent: slrn/0.9.7.4 (FreeBSD)
 by: Volker Englisch - Wed, 5 Jul 2023 15:56 UTC

Volker Englisch schrieb am 05.07.2023:
> PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
^^^^^
GREATER
> MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
> END-PERFORM
> MOVE DWB000-RECORD TO WS-LINE (15)
> END-IF.
> GO TO 1000-LOOP.

With a GREATER instead of EQUAL it runs the way it should.
Logical blackout of myself...

Re: Retrieve the 15 last records

<1688581399@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=462&group=comp.lang.cobol#462

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Wed, 05 Jul 2023 19:23:19 +0100
Organization: A noiseless patient Spider
Lines: 51
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1688581399@f1.n250.z2.fidonet.ftn>
References: <u83eke$2uks$1@selene.rsli.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="2916790df2f785ba8e50ef9c7a06be33";
logging-data="636938"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7RLTj+Nae5VwMtKxBUpB2"
Cancel-Lock: sha1:M3le7pLUa4L3dfsWzYUL4gHkyp0=
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 14 263/0 371/52 467/4 712/1321
X-FTN-PATH: 250/1
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
X-FTN-PID: GED+LNX 1.1.5-b20180707
X-FTN-CHRS: UTF-8 2
REPLY: selene.rsli.de f15b1328
X-FTN-TID: MBSE-FIDO 1.0.8.4 (Linux-x86_64)
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.117-server-2.mga8 CPU UNKNOWN)
X-Origin-Newsgroups: comp.lang.cobol
X-FTN-TZUTC: 0100
X-FTN-MSGID: 2:250/1@fidonet 64a5b731
X-Comment-To: "Volker Englisch" <eh41@selene.inka.de>
X-FTN-AREA: COMP.LANG.COBOL
 by: Vincent Coen - Wed, 5 Jul 2023 18:23 UTC

Hello Volker!

Wednesday July 05 2023 10:54, Volker Englisch wrote to All:

I would have said the easiest is to use OPEN REVERSED.
Then read first 15 records.

There again I am lazy.

Vince

> Hello all together!

> I need to retrieve the last matching records from a serial file. I
> tried it this way:

> 01 WS-LINES.
> 05 WS-LINE OCCURS 15 TIMES PIC X(40).

> 1000-LOOP.
> READ DWB000
> AT END ...
> END-READ.
> READ DWB000-RECORD.
> IF WS-ARTNO IS EQUAL DWB000-ARTNO THEN
> PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
> MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
> END-PERFORM
> MOVE DWB000-RECORD TO WS-LINE (15)
> END-IF.
> GO TO 1000-LOOP.

> Finally I get 15 empty lines. My intention was to push the LINEs
> downwards and move the currently found record into the highest line...

> And idea why that doesn't work? Or, is there another approach to
> accomplish it?

> I'm working with GnuCobol on FreeBSD, if that's important.

> TIA
> Volker

Vincent

Re: Retrieve the 15 last records

<u84imn$j3s$1@selene.rsli.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=463&group=comp.lang.cobol#463

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!selene.inka.de!.POSTED.localhost!not-for-mail
From: eh41@selene.inka.de (Volker Englisch)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Wed, 5 Jul 2023 22:09:59 +0200
Organization: Rabbit System
Message-ID: <u84imn$j3s$1@selene.rsli.de>
References: <u83eke$2uks$1@selene.rsli.de> <3e4bai5gnlbq4n0lhj58li5i6dgjqlr0la@4ax.com>
Injection-Date: Wed, 5 Jul 2023 20:09:59 -0000 (UTC)
Injection-Info: selene.rsli.de; posting-host="localhost:127.0.0.1";
logging-data="19580"; mail-complaints-to="usenet@selene.inka.de"
User-Agent: slrn/0.9.7.4 (FreeBSD)
 by: Volker Englisch - Wed, 5 Jul 2023 20:09 UTC

Joe schrieb am 05.07.2023:
> On Wed, 5 Jul 2023 11:54:22 +0200, Volker Englisch <eh41@selene.inka.de> wrote:
>>
>>I need to retrieve the last matching records from a serial file. I
>>tried it this way:
>>
>>01 WS-LINES.
>> 05 WS-LINE OCCURS 15 TIMES PIC X(40).
>>
>>1000-LOOP.
>> READ DWB000
>> AT END ...
>> END-READ.
>> READ DWB000-RECORD.
>> IF WS-ARTNO IS EQUAL DWB000-ARTNO THEN
>> PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
>> MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
>> END-PERFORM
>> MOVE DWB000-RECORD TO WS-LINE (15)
>> END-IF.
>> GO TO 1000-LOOP.
>>
>>Finally I get 15 empty lines. My intention was to push the LINEs
>>downwards and move the currently found record into the highest line...
>>
> I would first SORT the file around & then read first 15 ;-)

Well, the records are already in a date-wise sequence. Thanks for the
tip though

Re: Retrieve the 15 last records

<895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=468&group=comp.lang.cobol#468

  copy link   Newsgroups: comp.lang.cobol
From: none@nowhere.whereo (Joe)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Fri, 07 Jul 2023 13:39:58 +0000
Reply-To: none@nowhere.whereo
Message-ID: <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 13
Injection-Date: Fri, 07 Jul 2023 15:39:59 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1076
 by: Joe - Fri, 7 Jul 2023 13:39 UTC

On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen" <VBCoen@gmail.com> wrote:

>Hello Volker!
>
>Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
>
>I would have said the easiest is to use OPEN REVERSED.
>
>Vince
>

Didn't even know such a thing existed. Must a modern extention.

Re: Retrieve the 15 last records

<kgqtjiFb7siU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=469&group=comp.lang.cobol#469

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Fri, 7 Jul 2023 12:42:26 -0400
Lines: 21
Message-ID: <kgqtjiFb7siU1@mid.individual.net>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn>
<895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vYYtHiOkPY3oi+y67KtKpgoH0x0VBNYTSUL4q4B3auFXW8kq7w
Cancel-Lock: sha1:XuO5eZgrUCHbPs39QH2SmyvZHl4= sha256:BeFkcZWpDCcivsy9FMA+rBCNIs+RwOGxjUhTLy1RvJI=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.12.0
Content-Language: en-US
In-Reply-To: <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
 by: bill - Fri, 7 Jul 2023 16:42 UTC

On 7/7/2023 9:39 AM, Joe wrote:
> On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen" <VBCoen@gmail.com> wrote:
>
>> Hello Volker!
>>
>> Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
>>
>> I would have said the easiest is to use OPEN REVERSED.
>>
>> Vince
>>
>
> Didn't even know such a thing existed. Must a modern extention.

Caution!!
The original poster said he was using GnuCOBOL. Unless it has changed
since I grabbed it the Programmers Manual says "REVERSED" is
syntactically recognized but otherwise non-functional.

bill

Re: Retrieve the 15 last records

<u89h9e$j56$1@selene.rsli.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=470&group=comp.lang.cobol#470

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!selene.inka.de!.POSTED.localhost!not-for-mail
From: eh41@selene.inka.de (Volker Englisch)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Fri, 7 Jul 2023 19:16:30 +0200
Organization: Rabbit System
Message-ID: <u89h9e$j56$1@selene.rsli.de>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn>
Injection-Date: Fri, 7 Jul 2023 17:16:30 -0000 (UTC)
Injection-Info: selene.rsli.de; posting-host="localhost:127.0.0.1";
logging-data="19622"; mail-complaints-to="usenet@selene.inka.de"
User-Agent: slrn/0.9.7.4 (FreeBSD)
 by: Volker Englisch - Fri, 7 Jul 2023 17:16 UTC

Hi Vince!

Vincent Coen schrieb am 05.07.2023:
> Hello Volker!
>
> Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
>
> I would have said the easiest is to use OPEN REVERSED.
> Then read first 15 records.

Unfortunately my compiler doesn't support OPEN REVERSED :-(

From the manual: "The [...] REVERSE clause is syntactically
recognized but otherwise non-functional."

Volker

Re: Retrieve the 15 last records

<cc24f780-e6c0-47d3-9216-4f7162144b49n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=471&group=comp.lang.cobol#471

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:622a:15d2:b0:400:7e63:33a with SMTP id d18-20020a05622a15d200b004007e63033amr18040qty.12.1688767129889;
Fri, 07 Jul 2023 14:58:49 -0700 (PDT)
X-Received: by 2002:a17:903:41c3:b0:1b7:f24c:3ba3 with SMTP id
u3-20020a17090341c300b001b7f24c3ba3mr5570211ple.13.1688767129609; Fri, 07 Jul
2023 14:58:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.cobol
Date: Fri, 7 Jul 2023 14:58:49 -0700 (PDT)
In-Reply-To: <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.180.88.86; posting-account=CcFQgQoAAAB4uPj9HOgZiRCM2Y_v-jmi
NNTP-Posting-Host: 98.180.88.86
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn> <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cc24f780-e6c0-47d3-9216-4f7162144b49n@googlegroups.com>
Subject: Re: Retrieve the 15 last records
From: rs847925@gmail.com (Rick Smith)
Injection-Date: Fri, 07 Jul 2023 21:58:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2140
 by: Rick Smith - Fri, 7 Jul 2023 21:58 UTC

On Friday, July 7, 2023 at 9:40:02 AM UTC-4, Joe wrote:
> On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen" <VBC...@gmail.com> wrote:
>
> >Hello Volker!
> >
> >Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
> >
> >I would have said the easiest is to use OPEN REVERSED.
> >
> >Vince
> >
>
> Didn't even know such a thing existed. Must a modern extention.

REVERSED was available in the COBOL 60 Report.

"6. The REVERSED option can only be used on single reel input files."

1. OPEN INPUT file-name REVERSED

2. READ file-name

Retrieves the last record.

REVERSED was made obsolete in COBOL 85. and removed from COBOL 2002.

Beginning with the 2002 standard, one could get the same effect by:

1. OPEN INPUT file-name

2. START file-name LAST

3. READ file-name PREVIOUS

For START ... LAST, an INVALID KEY means there are no records in the file.

Re: Retrieve the 15 last records

<1688771216@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=472&group=comp.lang.cobol#472

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Sat, 08 Jul 2023 00:06:56 +0100
Organization: A noiseless patient Spider
Lines: 27
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1688771216@f1.n250.z2.fidonet.ftn>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn> <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="a696f171224411ecba25bc2d39bec498";
logging-data="1560020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18q54fucZtzvkcvVWK15VVK"
Cancel-Lock: sha1:0zwexnmL1K15p7v3mBhayreamXY=
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 14 263/0 371/52 467/4 712/1321
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.117-server-2.mga8 CPU UNKNOWN)
X-Comment-To: Joe <none@nowhere.whereo>
X-FTN-PID: GED+LNX 1.1.5-b20180707
X-FTN-CHRS: UTF-8 2
X-FTN-AREA: COMP.LANG.COBOL
X-Origin-Newsgroups: comp.lang.cobol
X-FTN-TZUTC: 0100
X-FTN-MSGID: 2:250/1@fidonet 64a89b47
X-FTN-TID: MBSE-FIDO 1.0.8.4 (Linux-x86_64)
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
REPLY: 4ax.com d6e7cd54
X-FTN-PATH: 250/1
 by: Vincent Coen - Fri, 7 Jul 2023 23:06 UTC

Hello Joe!

Friday July 07 2023 14:39, Joe wrote to All:

> On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen" <VBCoen@gmail.com>
> wrote:

>> Hello Volker!
>>
>> Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
>>
>> I would have said the easiest is to use OPEN REVERSED.
>>
>> Vince
>>

> Didn't even know such a thing existed. Must a modern extention.

Not that modern, but has been in GnuCobol for some time.

I also see that it is in Micro Focus Workbench v3.3 dated 1993 via the
pocket guide or is that too modern :)

Vincent

Re: Retrieve the 15 last records

<u8actu$2fn$1@reader2.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=473&group=comp.lang.cobol#473

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix1.panix.com!not-for-mail
From: docdwarf@panix.com
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Sat, 8 Jul 2023 01:08:14 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <u8actu$2fn$1@reader2.panix.com>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn> <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com> <1688771216@f1.n250.z2.fidonet.ftn>
Injection-Date: Sat, 8 Jul 2023 01:08:14 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="2551"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Sat, 8 Jul 2023 01:08 UTC

In article <1688771216@f1.n250.z2.fidonet.ftn>,
Vincent Coen <VBCoen@gmail.com> wrote:
>Hello Joe!
>
>Friday July 07 2023 14:39, Joe wrote to All:
>
> > On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen" <VBCoen@gmail.com>
> > wrote:
>
> >> Hello Volker!
> >>
> >> Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
> >>
> >> I would have said the easiest is to use OPEN REVERSED.
> >>
> >> Vince
> >>
>
> > Didn't even know such a thing existed. Must a modern extention.
>
>
>Not that modern, but has been in GnuCobol for some time.
>
>I also see that it is in Micro Focus Workbench v3.3 dated 1993 via the
>pocket guide or is that too modern :)

1993? That's only thirty years ago... let's not be hasty!

DD

Re: Retrieve the 15 last records

<1688826140@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=474&group=comp.lang.cobol#474

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Retrieve the 15 last records
Date: Sat, 08 Jul 2023 15:22:20 +0100
Organization: A noiseless patient Spider
Lines: 77
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1688826140@f1.n250.z2.fidonet.ftn>
References: <u83eke$2uks$1@selene.rsli.de> <1688581399@f1.n250.z2.fidonet.ftn> <895gai1jk6t0a97ihbioh22lg57iolo0fe@4ax.com> <cc24f780-e6c0-47d3-9216-4f7162144b49n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="a696f171224411ecba25bc2d39bec498";
logging-data="1871782"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cvb+BDx7N6NPKyrg6qIN6"
Cancel-Lock: sha1:ow2vzh0xEm0Ha5CHYtC2CMBdjd4=
X-FTN-CHRS: UTF-8 2
X-FTN-TZUTC: 0100
X-FTN-AREA: COMP.LANG.COBOL
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.117-server-2.mga8 CPU UNKNOWN)
X-FTN-PATH: 250/1
X-Origin-Newsgroups: comp.lang.cobol
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 14 263/0 371/52 467/4 712/1321
X-FTN-PID: GED+LNX 1.1.5-b20180707
X-FTN-MSGID: 2:250/1@fidonet 64a974cd
X-FTN-TID: MBSE-FIDO 1.0.8.4 (Linux-x86_64)
REPLY: googlegroups.com d9a27e31
X-Comment-To: "Rick Smith" <rs847925@gmail.com>
 by: Vincent Coen - Sat, 8 Jul 2023 14:22 UTC

Hello Rick!

Friday July 07 2023 22:58, Rick Smith wrote to All:

> On Friday, July 7, 2023 at 9:40:02 AM UTC-4, Joe wrote:
>> On Wed, 05 Jul 2023 19:23:19 +0100, "Vincent Coen"
>> <VBC...@gmail.com> wrote:
>> >Hello Volker!
>> >
>> >Wednesday July 05 2023 10:54, Volker Englisch wrote to All:
>> >
>> >I would have said the easiest is to use OPEN REVERSED.
>> >
>> >Vince
>> >
>>
>> Didn't even know such a thing existed. Must a modern extention.

> REVERSED was available in the COBOL 60 Report.

> "6. The REVERSED option can only be used on single reel input files."

> 1. OPEN INPUT file-name REVERSED

> 2. READ file-name

> Retrieves the last record.

> REVERSED was made obsolete in COBOL 85. and removed from COBOL 2002.

> Beginning with the 2002 standard, one could get the same effect by:

> 1. OPEN INPUT file-name

> 2. START file-name LAST

> 3. READ file-name PREVIOUS

> For START ... LAST, an INVALID KEY means there are no records in the
> file.

That will not work as p/o specified file is sequential and according to PG
for START :

--
To use this statement, file-name-1 must be an ORGANIZATION RELATIVE (see
[ORGANIZATION RELATIVE], page 107) or ORGANIZATION INDEXED (see
[ORGANIZATION INDEXED], page 109) file that must have been defined with an
ACCESS MODE DYNAMIC or ACCESS MODE SEQUENTIAL in its SELECT statement (see
[SELECT],
--

So ISAM files only.

There is nothing in the 'NEWS' file to indicate otherwise as of Friday.

Nor for that matter usage of REVERSED so that is in but ignored so that
will not work with GC. I did look for the tests to see if it was in and is
so but that could just be to confirm that the compiler would ignore it.
Nope, just looked at the tests input file and it is marked as :
obsolete and not implemented.

Sorry about that.

I cannot see any thing that replaces it in any way unless someone
implements START for sequential files or OPEN INPUT AT END for the same.

Looks like only option is as p/o had created by creating a table holding 15
records with a double perform to process it.

So much for my lazy way :(
My apologies for my stupid idea.

Vincent

Re: Solved (was: Re: Retrieve the 15 last records)

<b4414af4-46a1-4220-ac23-4fed3498a0bdn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=477&group=comp.lang.cobol#477

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:622a:1b8d:b0:3fd:df16:18f4 with SMTP id bp13-20020a05622a1b8d00b003fddf1618f4mr52267qtb.8.1689020463045;
Mon, 10 Jul 2023 13:21:03 -0700 (PDT)
X-Received: by 2002:a05:6a00:2d9e:b0:668:8fee:7b8 with SMTP id
fb30-20020a056a002d9e00b006688fee07b8mr18084500pfb.1.1689020462728; Mon, 10
Jul 2023 13:21:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.cobol
Date: Mon, 10 Jul 2023 13:21:02 -0700 (PDT)
In-Reply-To: <u843ql$9n1$1@selene.rsli.de>
Injection-Info: google-groups.googlegroups.com; posting-host=98.180.88.86; posting-account=CcFQgQoAAAB4uPj9HOgZiRCM2Y_v-jmi
NNTP-Posting-Host: 98.180.88.86
References: <u83eke$2uks$1@selene.rsli.de> <u843ql$9n1$1@selene.rsli.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b4414af4-46a1-4220-ac23-4fed3498a0bdn@googlegroups.com>
Subject: Re: Solved (was: Re: Retrieve the 15 last records)
From: rs847925@gmail.com (Rick Smith)
Injection-Date: Mon, 10 Jul 2023 20:21:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3029
 by: Rick Smith - Mon, 10 Jul 2023 20:21 UTC

On Wednesday, July 5, 2023 at 12:07:08 PM UTC-4, Volker Englisch wrote:
> Volker Englisch schrieb am 05.07.2023:
> > PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
> ^^^^^
> GREATER
> > MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
> > END-PERFORM
> > MOVE DWB000-RECORD TO WS-LINE (15)
> > END-IF.
> > GO TO 1000-LOOP.
>
> With a GREATER instead of EQUAL it runs the way it should.
> Logical blackout of myself...

The use of shift and insert may be very inefficient.

I recommend using a circular buffer instead. It will save
14 moves times the number of input records.

With a circular buffer, each record is inserted into the next
slot in the table replacing the previous unneeded record,
rather than shifting. When all input records have been
processed, the table used as the buffer may then be copied
or further processed to put the records into their correct
order.

For this example, I use n to hold the next position in the
buffer for a table of 15 records. Note that n will range from
1 through 15 due to the mod operation in increment-n.

---

01 input-record pic x(30).
01 output-record pic x(30).
01 n comp pic 9(4) value 1.
01 buffer.
02 buffer-entry pic x(30) occurs 15.

insert-record.
move input-record to buffer-entry (n)
perform increment-n
..

get-record.
move buffer-entry (n) to output-record
perform increment-n
..

increment-n.
compute n = function mod (n 15) + 1
..

---

After inserting the last record, n points to the first of
the 15 records to be processed, so no adjustment to n is
needed when changing from insert-record to get-record.

This is essentially a first-in-first-out (FIFO) queue with
no checks for overflow.

Re: Solved (was: Re: Retrieve the 15 last records)

<u8hs48$3f2$1@reader2.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=478&group=comp.lang.cobol#478

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix1.panix.com!not-for-mail
From: docdwarf@panix.com
Newsgroups: comp.lang.cobol
Subject: Re: Solved (was: Re: Retrieve the 15 last records)
Date: Mon, 10 Jul 2023 21:10:33 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <u8hs48$3f2$1@reader2.panix.com>
References: <u83eke$2uks$1@selene.rsli.de> <u843ql$9n1$1@selene.rsli.de> <b4414af4-46a1-4220-ac23-4fed3498a0bdn@googlegroups.com>
Injection-Date: Mon, 10 Jul 2023 21:10:33 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="3554"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Mon, 10 Jul 2023 21:10 UTC

In article <b4414af4-46a1-4220-ac23-4fed3498a0bdn@googlegroups.com>,
Rick Smith <rs847925@gmail.com> wrote:
>On Wednesday, July 5, 2023 at 12:07:08???PM UTC-4, Volker Englisch wrote:
>> Volker Englisch schrieb am 05.07.2023:
>> > PERFORM VARYING WS-COUNTER FROM 2 BY 1 UTIL WS-COUNTER EQUAL 15
>> ^^^^^
>> GREATER
>> > MOVE WS-LINE (WS-COUNTER) TO WS-LINE (WS-COUNTER - 1)
>> > END-PERFORM
>> > MOVE DWB000-RECORD TO WS-LINE (15)
>> > END-IF.
>> > GO TO 1000-LOOP.
>>
>> With a GREATER instead of EQUAL it runs the way it should.
>> Logical blackout of myself...
>
>The use of shift and insert may be very inefficient.

Not for testing 'who can write two-year programmer code'.

DD

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor