Guild Companies, Inc.  
 
Midrange Guru - Tech Tips
OS/400 Edition
Volume 2, Number 14 - February 22, 2002

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

Sponsored By
JACADA LTD.

Gartner Research on Legacy Extension and Jacada

See why Jacada is a leading legacy extension solution according to Gartner.

This 30-page report includes approaches to legacy extension, vendor rankings in the Magic Quadrant, and case studies. It’s a must-read for anyone planning legacy extension projects.

Get your copy at www.jacada.com/gartner/quadrant32

THIS ISSUE
SPONSORED BY:
WorksRight Software, Inc.
Jacada Ltd.
BACK ISSUES
TABLE OF CONTENTS
find and grep Performance Issues
FTP and Numeric Data
Reader Feedback and Insights: Returning a Value from a Prototyped Call
  Newsletters | Subscribe | Advertise | About Us | Contact | Search | Home  
  Last Updated: 2/22/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.