Archive for March, 2010

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:

Create FTP File command

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:

Field Mapping Utility command

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:

Field Mapping display

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:

Copy to Stream File command

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:

This e-book offers a progressive training on the AS/400 (iSeries) CL and RPG languages. It uses real life applications to investigate the latest ILE options and develop your programming skills..

The course starts with simple programs and then examines more advanced concepts such as subfiles programming, use of message subfiles, use of embedded SQL, development of ILE modules and binding into programs and service programs .

The index of the Ebooks is as follows:

  • Introduction
  • The OPM and ILE program models
  • The simple Cross Reference Utility
  • The Logical Database Structure
  • Skill No.1 – Database files / Tables creation
  • Skill No.2 – Developing a simple RPG program
  • Skill No.3 – Developing a general utility CL program
  • Skill No.3 – Developing simple CL utilities
  • Skill No.4 – Developing a subfile application (display)
  • Skill No.4 – Developing a subfile application (program)
  • Skill No.5 – Displaying messages in a message subfile
  • Skill No.6 – Using embedded SQL
  • Skill No.7 – Developing a printing program
  • Skill No.8 – Using page by page subfiles
  • Skill No.9 – Introducing ILE modules, procedures and service programs
  • Skill No.10 – Using Service Programs
  • Skill No.11 – Using ILE modules with a printing program
  • Skill No.12 – Developing a Batch Application
  • More ILE concepts
  • Bibliography

This is not a course for beginners because  it assumes some basic knowledge of the RPG language. It is meant to help people who already have some knowledge of the language  and want to improve their skills.


This book is no longer free, but you can download it for a good price from:

==> RPG ILE Training Ebook Download

You will find also useful books on this subject at Amazon as follows:

Incoming search terms for the article:

This is an Ebook which offers a progressive training on the AS/400 (iSeries) CL and COBOL languages. It contains some real life applications which are  used  to investigate the latest ILE options of the language and to develop your programming  skills and which are distributed as shareware.

The course starts with simple programs and then examines more advanced concepts such as subfiles programming, use of message subfiles, use of embedded SQL, development of ILE modules and binding into programs and service programs .

You can see below the index of the Ebook:

  • The OPM and ILE program models
  • The simple Cross Reference Utility
  • The Logical Database Structure
  • Skill No.1 – Database files / Tables creation
  • Skill No.2 – Developing a simple COBOL program
  • Skill No.3 – Developing a general utility CL program
  • Skill No.3 – Developing simple CL utilities
  • Skill No.4 – Developing a subfile application (display)
  • Skill No.4 – Developing a subfile application (program)
  • Skill No.5 – Displaying messages in a message subfile
  • Skill No.6 – Using embedded SQL
  • Skill No.7 – Developing a printing program
  • Skill No.8 – Using page by page subfiles
  • Skill No.9 – Introducing ILE modules, procedures and service programs
  • Skill No.10 – Using Service Programs
  • Skill No.11 – Using ILE modules with a printing program
  • Skill No.12 – Developing a Batch Application
  • The Delimited File Creation Utility and Activation Groups considerations
  • The Utility Control Program and Command
  • The File Field Description Creation Control Program
  • The File Field Description Creation Processing Program
  • The File Field Description Access Module
  • The Delimited File Creation Module
  • More ILE Concepts Summary
  • Bibliography


This book is no longer free, but you can download it for a small price from:

==> Cobol ILE Training Ebook Download

You will find also good books on this subject at Amazon. See below:

Incoming search terms for the article: