FTP transfer from PC to AS/400 syntax help

Can anyone give me  the correct syntax for transferring a file(zcoresavf.savf) from my pc to a savfile that has been created on the on the I5/AS/400?
Who is Participating?

ftp> [logon stuff first]
ftp> bin
ftp> quote site nam 1
ftp> put zcoresavf.savf /qsys.lib/mylib.lib/zcoresavf.savf
ftp> quit

First, BIN (BINARY) is necessary for savefiles.

Second, QUOTE SITE sends a FTP subcommand to the remote site. The subcommand in this case is NAM 1 (NAMEFMT 1) which allows you to reference objects in a PC naming syntax. This makes it easy to reference both source and target in the same syntax. Technically, specifying NAM 1 isn't strictly required here -- OS/400 will set the naming format to whatever format is used first. In this case, the PUT subcommand uses NAM 1. But it's a good idea to make this a habit. (NAM 1 also causes a .SAVF extension to be recognized as a savefile. If the savefile doesn't exist, OS/400 FTP will create a savefile. Since it's pre-created, that doesn't matter here.)

Third, PUT the savefile wherever you want it to go. Under NAM 1 syntax, use the .SAVF extension rather than a .FILE extension. You might need/want to specify the local path or use the current local working directory. The remote 'path' could also be set via CD. Note that forward-slash is the delimiter on the remote.

he could indeed use the classic ftp wihout switch to the namefmt 1 and avoid full paths to the library
something like:

cd library
put zcoresavf.savf zcoresavf.savf

to create the savefile before to execute the put add:
quote rcmd crtsavf library/zcoresavf
to clear it add:
quote rcmd clrsavf library/zcoresavf

Bye Muf
Since [cd library] is namefmt 0 and [put zcoresavf.savf zcoresavf.savf] is in namefmt 1, the format would need to switch explicitly at some point. Note that the PUT is being executed in a PC FTP client; therefore, the source for the PUT must be specified in PC-naming syntax.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.