How to FTP a FILE.savf from PC to AS400 as FILE

110 pts.
Tags:
AS/400
CLLE
FTP
FTP Automation
RPGLE Program
Can someone explain how to FTP from a PC, using a AS400 program (RPGLE or CLLE), a pc file (FILE.savf) to a AS400 savefile (FILEA) in library (LIBA). The only way I know is using a DOS window and entering commands. But I would like to use a program on AS400 to do this FTP. Can someone help?

Answer Wiki

Thanks. We'll let you know when a new response is added.

We go to a web site for BPCS program fixes, they are in a (.savf) save file. We download to the pc, but then it needs to be uploaded to AS400. The only way I know is FTP from pc. I am looking for an easy way for the operations people to do this. Do you have any suggestions?

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I'm not sure what you mean by "a program". The simplest possibility is a basic .BAT file. Create a file with .BAT as the extension. It might be as simple as a single line that is just the FTP command itself. The FTP command would have two parameters -- one would be the name of the script that you want FTP to run, and the other would be the remote host name or IP address of your AS/400. The script file is a simple text file that basically contains the FTP subcommands to supply user, password and the other subcommands that tell what file to transfer and how to do the transfer (e.g., BINARY). The general method is described in this Microsoft KB article. With a shortcut to the .BAT file on your desktop, you would simply double-click it to run the command. There is info all over the web about .BAT file execution. But maybe that's not what you mean. Clarify if you need some different method. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Sorry, I just realized that you apparently explicitly want a program to run on your AS/400. In that case, the first step is to install, configure and secure a FTP server on the PC. Without a server on the PC, there's no way for another system (your AS/400) to start a FTP session. But it would be easier to share a directory out from the PC. The AS/400 could then just use CPYFRMSTMF to copy into the savefile. No FTP needed. What would be needed is to create a local user with password on the PC that could match with a user profile on the AS/400. The AS/400 program would switch to that user, copy the file, then discard the switch. Are you absolutely set on using FTP? Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    The only way I know is FTP from pc. Normally, a PC user would run a Windows FTP command to upload the savefile. But your AS/400 can also use CPYFRMSTMF to copy a .SAVF file into a savefile. You might store the .SAVF in a shared directory on the PC. You could then run CPYFRMSTMF through the /QNTC path to the shared directory from the PC. Or the PC user might simply download from the BPCS site directly to an IFS directory, and CPYFRMSTMF would copy from there. That as, FTP is just one of the possible transport methods. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    ...And, of course, an almost trivial CL program could run the CPYFRMSTMF command. If the .SAVF is put in an accessible location, the command itself might be easier than a program to run. But if FTP must be used, please confirm. An AS/400 program can do it as long as the PC has a FTP server that the AS/400 program can connect to. Tom
    125,585 pointsBadges:
    report
  • Rick53
    I am looking for something simple for the operations people to use. They have no programming skills, but only use the tools we give them. I just want to get the file.savf from the pc, they are using as a workstation on the AS400, to the AS400 into a save file in a library.
    110 pointsBadges:
    report
  • TomLiotta
    Part of the problem is that this might simply be too easy. Here's what I just did: I had a file named nsrestjdbc.savf in a directory on my PC. I dragged it in Windows to my /home/toml directory on one of our AS/400s -- that is my default directory on that system. Then I ran this command:
    CPYFRMSTMF FROMSTMF( nsrestjdbc.savf )
               TOMBR( '/qsys.lib/qgpl.lib/nsrestjdbc.file' )
               MBROPT( *REPLACE )
               CVTDTA( *NONE )
               ENDLINFMT( *FIXED )
               TABEXPN( *NO )
    The result was a savefile created in QGPL named NSRESTJDBC. Simple, straightforward, no FTP. Just drag & drop and run the command. Now, in order for that to work, I had to have the NetServer server running on the AS/400. It had to be configured to be available from Windows Networking. It had to have /home/toml configured as a shared directory. And the File host server had to be running for NetServer to access the IFS. Most sites have NetServer running. Even more sites have the File host server running. There's a good chance that most of it is already set up. If yoiu have restrictions or problems with either of those, they can almost certainly be worked through. It's hard to imagine that any FTP solution could be as simple to put together and run. That's much more true if the FTP server will be on the PC. If the BPCS download was saved directly into my /home/toml directory, then even the drag & drop wouldn't have been needed -- just the single command and it's done. I don't know how it could be simpler. Tom
    125,585 pointsBadges:
    report
  • Rick53
    That is what I am looking for - thanks a lot!
    110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following