Kbase P84061: 4GL/ABL: Error (557) using the SET and the INPUT FROM or INPUT THROUGH statements to read data into
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/12/2009 |
|
Status: Verified
SYMPTOM(s):
4GL/ABL: Error (557) using the SET and the INPUT FROM or INPUT THROUGH statements to read data into a variable.
** File input too long: <string>. (557)
Code includes a SET statement with an INPUT FROM or an INPUT THROUGH statement. For example:
DEFINE VARIABLE cVariable AS CHARACTER NO-UNDO.
INPUT THROUGH VALUE(someOSCommand) NO-ECHO.
SET cVariable.
INPUT CLOSE.
Or
DEFINE VARIABLE cVariable AS CHARACTER NO-UNDO.
INPUT FROM SomeFile.txt.
SET cVariable.
INPUT CLOSE.
FACT(s) (Environment):
All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
CAUSE:
There is too much data for the input field. For example a 10-character string is read from the file for a character field with format "x(8)" and it is tried to be set.
FIX:
Use the IMPORT statement instead of the SET statement. For example:
DEFINE VARIABLE cVariable AS CHARACTER NO-UNDO.
INPUT THROUGH VALUE(someOSCommand) NO-ECHO.
IMPORT UNFORMATTED cVariable.
INPUT CLOSE.
Or use the FORMAT phrase in the SET statement to specify the maximum possible length of the value being imported or set into cVariable. For example:
DEFINE VARIABLE cVariable AS CHARACTER NO-UNDO.
INPUT FROM SomeFile.txt.
SET cVariable FORMAT "X(60)".
INPUT CLOSE.