|
FTP and Numeric Data
Hey, Ted:
I am trying to FTP a file from my AS/400 to a Windows
NT server. Everything is fine except that the negative numbers
do not translate properly. Do you have any clues as to why this
is happening and what I can do to solve this problem?
-- Hugh
The sign of decimal data is indicated by a special overpunch in the low-order byte. The term overpunch comes from the days of paper cards, when an extra hole was punched in the card to indicate sign. For zoned decimal data, the sign is placed in the first four bits of the low-order byte; for packed decimal data, the sign is placed in the last four bits of the low-order byte. The sign for positive data under OS/400 is hex F. For negative data, the sign is hex D.
The problem is that these values don't translate correctly from EBCDIC to ASCII. I suggest that you use the Copy to Import File (CPYTOIMPF) command to convert the data to a format that your PC can handle and FTP that file to your PC.
In the following example, a file called CUSTOMER is copied to a comma-delimited file in the OS/400 IFS:
CPYTOIMPF FROMFILE(CUSTOMER) TOSTMF('/home/jsmith/cust.csv')
RCDDLM(*CRLF).
-- Ted
|