Home > Archive > Cobol > December 2004 > FUNCTION LENGTH() in PERFORM VARYING
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
FUNCTION LENGTH() in PERFORM VARYING
|
|
| Lueko Willms 2004-12-21, 8:55 pm |
| Again with Compiler Fujitsu 3.0 I have another problem:
I wanted to calculate the length of a string (subtracting the trailing
blanks) by one of the methods presented by Chuck Stevens, but the
compiler won't let me specify a FUNCTION as argument for the FROM
clause
I have a data structure like this:
[code]
01 OUTFILE-NAME.
40 Laenge PIC 9(4) COMP.
40 FIX PIC X(512).
40 VAR REDEFINES FIX.
41 FILLER PIC X
OCCURS 0 TO 512 TIMES
DEPENDING ON Laenge OF NAME
| |
| Richard 2004-12-22, 8:55 am |
| > Now, who is wrong, me or the compiler?
PERFORM does not allow an arithmetic expression in the FROM clause.
| |
| Chuck Stevens 2004-12-22, 8:55 am |
| "Richard" <riplin@Azonic.co.nz> wrote in message
news:1103663938.967907.5940@c13g2000cwb.googlegroups.com...
> PERFORM does not allow an arithmetic expression in the FROM clause.
>
Note that the restriction that a function-identifer for an integer function
could only be used in an arithmetic expression (ANSI X3.23a-1989 page A-11,
4.3.8.3.3, Function-identifier, syntax rule 4) was lifted in ISO/IEC
1989:2002, in which standard it can be used anywhere a numeric sending field
can be used. I believe this difference, or a subset of it, was a common
implementor-defined extension anyway.
-Chuck Stevens
|
|
|
|
|