One of the challenges of working with IBM AS/400 (also known as System i) platform is that is designed following completely different principles from other contemporary systems. For one, they use a text-based interface, which now feels ancient and unfamiliar to most. These systems can be powerful, but they are certainly complex. There is no tutorial, and not easy way to discover information. You need to read a manual to use them, but even that are hard to find. In a word, they are esoteric: they work for people trained in them, but they are hard to understand for newcomers.
So, even relatively simple things, like extracting some files are hard to do: it is difficult to find the files are and to actually perform the commands to extract them. This is where this guide comes in.
The Guide
Navigating an AS/400 system can be challenging for inexperienced users, and extracting files is not a common task. Therefore in this guide, we will show you how to extract files using standard tools whenever possible—tools that should be familiar to users across different platforms.
The first step is to ensure that the SSH server in the system is running.
Ensure SSH Server is Running
- Log in the system, you should see a command prompt similar to this.

- Ensure the cursor is under Selection or command, next to the arrow and type
STRTCPSVR SERVER(*SSHD)
- If SSH is already running, you’ll see a message saying it’s already active.
- If SSH is not started, this command will attempt to start it.
Locate RPG Files in IFS
RPG files can be stored in the Integrated File System (IFS) or inside the system database, but they can also be stored. Let’s start with this first case, since it is the easier one.
- Access the IBM system with SSH. Use SSH to access the system, where <user> is the name of your user on the IBM system and <ibm_system> is the IP address or host name of the IBM system.
ssh <user>@<ibm_system>
- Locate the files. At this point you can locate the files using standard POSIX tools, like find.
find . -type f -name "*.rpg*"
The previous command will just find RPG source files, but you will need also the DDS files, that describes the format of the data used in RPG programs. Look whether any *.dds/*.dspf files present in the directory containing RPG files. Once you have a list of these directories, you can proceed to the next step.
- Copy the files. Exit the SSH connection or open another terminal and copy the files using SCP. You need to run the following command from your local computer, not from inside the IBM system.
scp -r <user>@<ibm_system>:/path/to/rpg_files /local/destination
This should take care of the case in which RPG files are available in IFS.
Locate RPG Files in the Database
Given that the files are located in the system database, in theory you could connect to the DB2 database using any Database Tool that supports DB2. The problem is that the files are stored line by line, similar to this.

If you have a DB administrator or developer available to create a script, you can go this route: loop through the tables, extract the lines and reconstruct the file. However, this is not convenient, so we suggest using an external tool.
Install External Tools for Easy Access and Login
Now, that you have enabled SSH, you can access your IBM system from a computer using a more familiar system (i.e., Windows, macOS, Linux).
- Install VS Code. Install Visual Studio Code, a widely used development tool (IDE) designed by Microsoft.
- Install an extension to support IBM i. Add the Extension Code for IBM i to VS Code. This is an extension to work with RPG, COBOL, etc. code from within VS Code.

The extension allows you to connect to an IBM i system and comes with several browsers (IFS, Object file system, etc.) to explore the files present in the system and work with them. It is mainly designed to develop code on an IBM i system, but it also allows accessing the system in a way that would be familiar to any sysadmin or developer.
Download the Source Files
We can now proceed to download the RPG source files stored in the database.
- Login to your AS/400 system. Follow the official documentation to fill your connection details to the system.
- Create a SQL file. Right-click on the directory inside the IFS Browser.

Click on New File… and pick a name, for instance, hello.sql.
- Use SQL to list all libraries. Add a SQL statement to list all libraries on the system inside the newly created file.
SELECT SCHEMA_NAME AS LIBRARY_NAME FROM QSYS2.SYSSCHEMAS ORDER BY SCHEMA_NAME;
The select the statement and click the button (Run SQL statement) in the top right corner to execute the SQL statement.

A list of libraries will appear in the bottom panel.

- Select each library. Now go in the Object browser panel and click on Create new filter…
A form will appear. Input the name of the first library you have found. In our example is STRUMENTA1.

- Select the files. Clicking on the filter will update the list of files in the library. In the Object Browser you will see a list of folders for each kind of file, such as qrpglesrc for RPG files. The terminology might seem confusing: we are using the Object Browser, and what we would call source code files (i.e., RPG files) are referred to as objects or members. That is because in IBM parlance a source file the group of files inside a library. The actual files are members or objects.

- Download the files. Right-click on the qrpglesrc (RPG source files) and click Download.

You will be prompted for a location where to save the files. Repeat the process for qddsrc (DDS source files).
- Repeat steps 4-6 for each library found on step 3. You should now have all RPG and DDS files on your local system.
Access the Terminal
You should now verify that you have access to the Bash terminal on your IBM system.
- Login to your AS/400 system. Follow the official documentation to fill your connection details to the system.
- Launch the terminal. Hover your mouse on the name of your system that should appear in the bottom left corner of your VS Code.

In the previous image the system is called pub400. A menu will appear, which will include the item Terminals. Click on it and a new menu will appear on the top center of VS Code.

Select the PASE item. This would make appear the bash terminal on the lower part of VS Code. If there is no PASE item, you will have to install the IBM Portable Application Solutions Environment for i (PASE for i) on your IBM system.
Resources
This article provides insight into the Strumenta approach in migrating an ERP system from IBM RPG to Python based on our experience with a real project in the manufacturing industry.
This article explores the challenge will be transforming RPG code into Clear Sequence Diagrams
If you are looking for a Ready-to-go parser here you can find a tutorial.