Consultor Eletrônico



Kbase P4567: Using PUT UNFORMATTED To Write Fixed Length Record Results In Record Being One Character Too Short
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/10/2008
Status: Verified

FACT(s) (Environment):

Windows 32 Intel
Windows NT 32 Intel/Windows 2000

SYMPTOM(s):

Using PUT UNFORMATTED <x> SKIP command

Records in output file are not correct length

CAUSE:

Using the PUT UNFORMATTED <x> AT <y> command to place a space in the last position of a record to ensure that a fixed length record is written is resulting in a fixed length record that is one character less than the length that is expected.

FIX:

Ensure that the code that is outputting the space is as follows:

PUT UNFORMATTED " " AT 320 SKIP

instead of the following:

PUT UNFORMATTED "" AT 320

The difference between the two statements is that the first one outputs a one character long string that contains a space and the second one outputs a zero length string.