Re: append a string to another
From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 12/21/04
- Next message: Lueko Willms: "SUM clause in REPORT WRITER - Problems"
- Previous message: Volker Thebrath: "UNICODE in Realia 6.2"
- In reply to: JJ: "Re: append a string to another"
- Next in thread: Joe Zitzelberger: "Re: append a string to another"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 21 Dec 2004 08:34:27 -0800
Something like
string function trim (thelongstring, right), function trim (in-data,
right) ...
is being proposed as part of the Any-Length Elementary Item proposal for the
2008 standard. The second argument may also be "left", in which case it's
*leading* spaces that don't figure into the result, and in the absence of a
second argument, both leading and trailing spaces are omitted.
In 2002 COBOL, writing one or more user-defined functions to accomplish
these tasks should be straightforward.
-Chuck Stevens
"JJ" <jj@nospam.com> wrote in message
news:87GdnTmvY7WSGVrcRVn-3Q@comcast.com...
> As others have said, find the last non-space of the strings, then use the
> STRING verb with reference modifiers denoting the content length of each
> variable.
>
> This is a case where it sure would be nice to have a DELIMITED BY TRAILING
> SPACES clause, such as:
>
> string thelongstring, in-data delimited by trailing spaces .....
>
> (don't try this - it doesn't exist - I'm just suggesting that it would be
> nice to have)
>
>
>
> "Tobias Neubert" <t1@s-neubert.net> wrote in message
> news:ea2fae75.0412200727.c44265f@posting.google.com...
> > Hi,
> >
> > I am a Cobol newby, trying to write a first program which reads in a
> > textfile, line by line and concatenates the lines to one big string. I
> > do the following:
> >
> > ------------
> > string thelongstring delimited by size
> > In-Data delimited by size
> > into thelongstring
> > ---------------
> >
> > thelongstring is 32000 bytes long, In-Data is 80 bytes long. It seems
> > that cobol appends In-Data at the very end of thelongstring, that is
> > after the last space at position 32000.
> >
> > Please tell me how it is possible to solve my problem.
> >
> > Thanks and Kind Regards,
> > Tobias Neubert
>
>
- Next message: Lueko Willms: "SUM clause in REPORT WRITER - Problems"
- Previous message: Volker Thebrath: "UNICODE in Realia 6.2"
- In reply to: JJ: "Re: append a string to another"
- Next in thread: Joe Zitzelberger: "Re: append a string to another"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|