Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Just think, with VLSI we can have 100 ENIACS on a chip!" -- Alan Perlis


devel / comp.lang.cobol / How to remove characters in a string in GNUCobol

SubjectAuthor
* How to remove characters in a string in GNUCobolBruce Axtens
+* Re: How to remove characters in a string in GNUCoboldocdwarf
|`* Re: How to remove characters in a string in GNUCobolBruce Axtens
| `- Re: How to remove characters in a string in GNUCoboldocdwarf
`- Re: How to remove characters in a string in GNUCobolVincent Coen

1
How to remove characters in a string in GNUCobol

<267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a37:a993:0:b0:705:b20d:3491 with SMTP id s141-20020a37a993000000b00705b20d3491mr203327qke.511.1673315998460;
Mon, 09 Jan 2023 17:59:58 -0800 (PST)
X-Received: by 2002:a05:622a:4d99:b0:3ac:3479:92 with SMTP id
ff25-20020a05622a4d9900b003ac34790092mr715789qtb.166.1673315998302; Mon, 09
Jan 2023 17:59:58 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 9 Jan 2023 17:59:58 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=60.231.231.174; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 60.231.231.174
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com>
Subject: How to remove characters in a string in GNUCobol
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Tue, 10 Jan 2023 01:59:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1268
 by: Bruce Axtens - Tue, 10 Jan 2023 01:59 UTC

The statement
MOVE FUNCTION SUBSTITUTE(WS-PHRASE, "-", "") TO WS-PHRASE-TEMP.
during compile gives
warning: alphanumeric literal has zero length; a SPACE will be assumed
and thus dashes get replaced with spaces.

How do I *remove* dashes?

-- Bruce

Re: How to remove characters in a string in GNUCobol

<tpimim$be$2@reader2.panix.com>

  copy mid

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

  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: How to remove characters in a string in GNUCobol
Date: Tue, 10 Jan 2023 03:37:58 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <tpimim$be$2@reader2.panix.com>
References: <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com>
Injection-Date: Tue, 10 Jan 2023 03:37:58 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="366"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Tue, 10 Jan 2023 03:37 UTC

In article <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com>,
Bruce Axtens <bruce.axtens@gmail.com> wrote:
>The statement
> MOVE FUNCTION SUBSTITUTE(WS-PHRASE, "-", "") TO WS-PHRASE-TEMP.
>during compile gives
> warning: alphanumeric literal has zero length; a SPACE will be assumed
>and thus dashes get replaced with spaces.
>
>How do I *remove* dashes?

INITIALIZE SUB2
WS-FLDB.
MOVE FUNCTION LENGTH(WS-FLDA) TO WS-FLDLEN.
PERFORM VARYING SUB1 FROM 1 BY 1
UNTIL SUB1 > WS-FLDLEN
IF WS-FLDA(SUB1:1) NOT = '-'
ADD 1 TO SUB2
MOVE WS-FLDA(SUB1:1) TO WS-FLDB(SUB2:1)
END-IF
END-PERFORM.

.... or something like that.

DD

Re: How to remove characters in a string in GNUCobol

<309cd6a8-f477-4964-ae7c-6349085528d5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:620a:890:b0:6fe:ab3e:3d09 with SMTP id b16-20020a05620a089000b006feab3e3d09mr2160742qka.111.1673327732290;
Mon, 09 Jan 2023 21:15:32 -0800 (PST)
X-Received: by 2002:a05:620a:2b83:b0:704:a47a:7176 with SMTP id
dz3-20020a05620a2b8300b00704a47a7176mr3879064qkb.492.1673327732068; Mon, 09
Jan 2023 21:15:32 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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: Mon, 9 Jan 2023 21:15:31 -0800 (PST)
In-Reply-To: <tpimim$be$2@reader2.panix.com>
Injection-Info: google-groups.googlegroups.com; posting-host=60.231.231.174; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 60.231.231.174
References: <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com> <tpimim$be$2@reader2.panix.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <309cd6a8-f477-4964-ae7c-6349085528d5n@googlegroups.com>
Subject: Re: How to remove characters in a string in GNUCobol
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Tue, 10 Jan 2023 05:15:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1342
 by: Bruce Axtens - Tue, 10 Jan 2023 05:15 UTC

On Tuesday, 10 January 2023 at 11:37:59 am UTC+8, docd...@panix.com wrote:
>
> ... or something like that.
>
Indeed, something like that. Thank you very much, sir.

-- Bruce

Re: How to remove characters in a string in GNUCobol

<tpkc91$g72$1@reader2.panix.com>

  copy mid

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

  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: How to remove characters in a string in GNUCobol
Date: Tue, 10 Jan 2023 18:54:25 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <tpkc91$g72$1@reader2.panix.com>
References: <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com> <tpimim$be$2@reader2.panix.com> <309cd6a8-f477-4964-ae7c-6349085528d5n@googlegroups.com>
Injection-Date: Tue, 10 Jan 2023 18:54:25 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="16610"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Tue, 10 Jan 2023 18:54 UTC

In article <309cd6a8-f477-4964-ae7c-6349085528d5n@googlegroups.com>,
Bruce Axtens <bruce.axtens@gmail.com> wrote:
>On Tuesday, 10 January 2023 at 11:37:59 am UTC+8, docd...@panix.com wrote:
>>
>> ... or something like that.
>>
>Indeed, something like that. Thank you very much, sir.

Mr Axtens, you did your own homework, showed it to the group and asked for
assistance. All I did was continue in the spirit, a mere bagatelle.

(and that's Sergeant, not Sir... *my* parents were married)

DD

Re: How to remove characters in a string in GNUCobol

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

  copy mid

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

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: How to remove characters in a string in GNUCobol
Date: Wed, 11 Jan 2023 14:52:49 +0000
Organization: A noiseless patient Spider
Lines: 18
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1673448769@f1.n250.z2.fidonet.ftn>
References: <267c8b9c-3fb2-40de-94bd-5642cbff7774n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="9e290d5f092c32fa0c8badddeb207d7d";
logging-data="989334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cZ2CQZ/LKqVUpKuut9RF5"
Cancel-Lock: sha1:SZ4S+6T5m20ZCAAFQ6zllpnIE04=
X-FTN-MSGID: 2:250/1@fidonet 63becd5c
REPLY: googlegroups.com d97e3913
X-FTN-CHRS: UTF-8 2
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-TID: MBSE-FIDO 1.0.8.2 (Linux-x86_64)
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 263/0 371/52 467/4 712/1321
X-Origin-Newsgroups: comp.lang.cobol
X-Comment-To: "Bruce Axtens" <bruce.axtens@gmail.com>
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.82-server-1.mga8 CPU UNKNOWN)
X-FTN-AREA: COMP.LANG.COBOL
X-FTN-TZUTC: 0000
 by: Vincent Coen - Wed, 11 Jan 2023 14:52 UTC

Hello Bruce!

Tuesday January 10 2023 01:59, Bruce Axtens wrote to All:

> The statement
> MOVE FUNCTION SUBSTITUTE(WS-PHRASE, "-", "") TO WS-PHRASE-TEMP.
> during compile gives
> warning: alphanumeric literal has zero length; a SPACE will be
> assumed and thus dashes get replaced with spaces.

> How do I *remove* dashes?

Does using SUBSTITUTE-CASE work ?

Vincent

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor