How To
Summary
You can use a IBM i, or Red Hat Linux as your cloud server using FTP. This document shows you how to set up an FTP resource and copy data to and from an FTP server. It uses another IBM i as the FTP server.
Steps
For all steps, unless specifically noted, steps are to be performed on the IBM i that you are copying data from.
Create directory on the FTP server to hold the data you transfer to the FTP server:
** This step must be done on the FTP server **
For this example, I use IBM i server to act as my cloud. On the IBM i you intend to use as your FTPserver, create a folder
MKDIR '/FTPCloudServer'
Create the FTP resource:
You must create the FTP resource by using the CRTFPRICC command.
CRTFPRICC RSCNM(FTPSVR)
RSCDSC('FTP server to system xxxxxxxx')
USRID(xxxxxxxx)
PASSWORD(xxxxxxxxxxxxxxxx)
ROOTDIR('/FTPCloudServer')
RSCURI(nn.nn.nn.nn)
CRTFPRICC RSCNM(FTPSVR)
RSCDSC('FTP server to system xxxxxxxx')
USRID(xxxxxxxx)
PASSWORD(xxxxxxxxxxxxxxxx)
ROOTDIR('/FTPCloudServer')
RSCURI(nn.nn.nn.nn)
For the RSCURI, use the IP address or name of your IBM i you are using as your FTP server. For ROOTDIR, use the directory that you created on your FTP server Note, /home/xxxxx should not be used for ROOTDIR. For USERID and PASSWORD, use your userid and password for the IBM i you are using as your FTP server.
Use the WRKCFGICC command to see the resource you created.
Copy file to the cloud:
Now you are ready to copy an IFS file to the cloud. Cloud Storage Solutions for i only works with IFS files including virtual tape or optical files.
First, start the subsystem:
STRSBS QICC/QICCSBS
Copy to the cloud:
CPYTOCLD RESOURCE(FTPSVR)
LOCALFILE('/icctestfile.txt')
CLOUDFILE(TestFTPfile.txt)
Use the WRKSTSICC *ALL *ALL command to check the status of your transfer:

Note the status is successful. If it was still in progress, it would have a status of active, and show the percent complete.
** This step must be done on the FTP server **
To verify that it made it to the FTP server, do a WRKLNK '/FTPCloudServer/*':

** This step must be done on the FTP server **
To verify that it made it to the FTP server, do a WRKLNK '/FTPCloudServer/*':

The file with extension .mta contains metadata information used by Cloud Storage Solutions for i.
Copy the file from the cloud:
Copy the file back from the cloud by using the CPYFRMCLD command:
CPYFRMCLD RESOURCE(FTPSVR)
CLOUDFILE(TestFTPfile.txt)
LOCALFILE('/icctestfileFromCloud')
Check the status by using WRKSTSICC *ALL *ALL:

CPYFRMCLD RESOURCE(FTPSVR)
CLOUDFILE(TestFTPfile.txt)
LOCALFILE('/icctestfileFromCloud')
Check the status by using WRKSTSICC *ALL *ALL:

Use WRKLNK to see the new file exists:

You successfully created an FTP resource, and copied a file to and from the FTP server.
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.3.0"}]
Was this topic helpful?
Document Information
Modified date:
27 March 2023
UID
ibm16452329