|
From: David E. <de...@us...> - 2005-07-09 18:31:53
|
Carlos Gomes wrote:
> In the test program above, the second display (results of String verb
> using DELIMITED BY SPACES) generate a strange output. DEMILITED BY
> SPACES in the fourth string causes a truncation in the first string
> (by default DEMILITED BY SIZE).
> DISPLAY 3, including DELIMITED BY SIZE explicity in the first string,
> generates the expected output.
If I understand you correctly, the second display is generating this output,
2-INSERT,999,12345);
and should be generating this output,
2-INSERT INTO TEST ,999,12345);
correct ?
I've looked at the COBOL 1989 (draft) standard, and I think TC is
generating the correct output '2-INSERT,999,12345);', for the following
reasons.
The figurative constant SPACES (literal) is equivalent to " " (single
space).
Thus the phrase 'DELIMITED BY SPACES' is equivalent to
'DELIMITED BY " "'.
And the literal 'INSERT INTO TEST ' gets truncated to 'INSERT'.
BTW, what are other commercial compilers generating ?
Syntax:
STRING {
{identifier-1 | literal-1}...
DELIMITED [BY]
{identifier-2 | literal-2 | SIZE }
}...
INTO identifier-3
COBOL standard:
14.10.39 STRING statement
...
14.10.39.3 General rules
...
3) When a figurative constant is specified as literal-1 or literal-2, it
refers to an implicit one character data item whose usage shall be the
same as the usage of identifier-3, either display or national.
|