[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] line sequential and string.
From: |
Brian Tiffin |
Subject: |
Re: [open-cobol-list] line sequential and string. |
Date: |
Tue, 3 Mar 2009 01:39:14 -0500 |
User-agent: |
KMail/1.9.9 |
ORGANIZATION IS LINE SEQUENTIAL records do NOT retain the newline and
carriage-return is stripped. (But I didn't look too closely into extfh
external SEQ/RAN handlers. But that only kicks in if that is configured).
In the FD (not the FILE-CONTROL SELECT) include the VARYING DEPENDING ON
clause.
FD somelineseq
RECORD SIZE IS VARYING
DEPENDING ON reclenfield ...
After each read, the record buffer is SPACE filled and the length actually
read (ignoring truncation, actual file record length, skipping any
carriage-return and terminated by line-feed) will be in reclenfield.
And then you can play reference modification tricks like
MOVE "}" TO destbuff(reclenfield + 1 : 1)
with your own tests for destbuff sizing, or cobc -debug to trap out any refmod
out of bounds.
Cheers,
Brian
On March 2, 2009 06:28:54 pm John Culleton wrote:
> 1. Does a line sequential record that is read in and is
> shorter than the receiving record description retain its
> EOL character or is it stripped off?
>
> 2. If it retains the EOL character how do I designate it in
> Open Cobol?. I am working on a Linux system. I want to do
> a STRING placing a "}" after the last printable character
> which means I need to use a DELIMITED BY EOL or however
> it is designated in OC.
>
> I can always fill with HIGH VALUES or something and test for
> that but that seems a bit clumsy.