AS/400 and Linux/Unix/PC Transfer Utilities
1. Introduction
The following report presents some AS/400 File Transfer utilities that allow an easies integration with Linux or Unix or PCs applications.
Data transfers between separate machines can easily be performed with FTP, but , when AS/400 and Linux/Unix/PC machines are involved, some data format conversion is often required as described below:
- The AS/400 uses the EBCDIC character set, whereas Linux, Unix and PC machines use ASCII. The conversion is normally done automatically by FTP.
- Numbers are often stored on the AS400 in Packed Decimal format (2 digits per byte) that is not directly supported by Linux, Unix and PC. Packed decimal fields must therefore be unpacked when copying data for Linux.
- In the AS/400 files the decimal point is implied according to the field definition. For instance if a field is 11 digits long with 2 decimals, no decimal point exists in the epresentation of the numbers, but the system automatically treats the last 2 digits as decimals. When numeric fields with decimals must be transferred to Linux, an explicit decimal point must be added in the correct position.
It is normally difficult to use direct transfers, because of packed fields and fixed length field requirements on the AS/400 files described above.
We have therefore developed some utilities that allow to make easier transfers from AS/400 database files to stream files and from stream files to the AS/400 database files.
2. Database File to Stream File Copy
The utility consists of a command (UCRTFTPFIL) and some programs that perform all needed data conversions. The AS/400 packed fields are converted into numeric fields and
an explicit decimal point is added when there are decimals. Moreover a field separator is added to identify the end of each field.
The command prompts the command parameters in the following mask:

It should be noticed that the user can select the separator (e.g. the pipe character) and the decimal point to use (dot or comma).
3. Stream File to Database File Copy
The utility assumes that the stream file contains fields separated by a separator. It is not requested to have the fields in the same sequence as those on the AS/400 database file.
The mapping of the fields can be entered by using the utility program UFMAP01L, that displays the following screen:

When one select one row by entering a ‘2’, the program displays a list of the fields in database files and allows to enter the sequence number of the corresponding field on the stream file (described on the screen as FTP file because it is normally received by FTP).
See the example below:

In the example above, the field number 1 of the stream file (see From FldNo) is mapped to the field CT0010 of the AS/400 database file, the field number 2 is mapped to CT0030 and the field number 3 is mapped to CT0020.
Once the mappings have been defined, it is possible to perform the copy by using the command UCPYFTP that prompts the user for the following data:

Also in this case the user is required to specify the separator and the decimal point used for the numbers.
It should be mentioned that the field mappings must be specified only once for each couple of files and that the copy command uses them automatically.
You can download the AS/400 and Linux/Unix/PC File Transfer Utilities from:
==> AS/400 File Transfer Utilities
Incoming search terms for the article:
- as400
- as 400
- as/400
- as400 file transfer
- as-400
- as400 file transfer utility
- as 400 file transfer
- as400 computer system
- decimals gif
- iseries file transfer utilities
Tagged with: AS400 and Linux Integration • AS400 File Tranfer Utilities
Filed under: AS400 File Transfer Utilities
Like this post? Subscribe to my RSS feed and get loads more!



There exist only a couple of blogs that I do remark on.This especially took hold of my attention. I like how you you are thorough on the tips particularly on this subject matter. Nice tips and great work. Thank you!
There exist only a few blogs that I do comment on. This one especially captured my attention. I like how you elaborate on the points, regarding this subject matter. Nice points and fantastic work. Thanks!
Valuable info. Lucky me I found your site by accident, I bookmarked it.
Thank you for your help! I cant find contact form or email adress. Can I ask you how can I get Backlink from your site!?? Interested about exchange. Looking to hear back from you. Thanks
:):)
There is a ContuctUs option on the menu. Click that and you will be able to enter messages into a contact form
Regards