I have received a save file
from the client which is huge approx 2 GB+ and I want to copy that save file IFS
to a library
. So I first zipped that file using the WinSCP
tool and uploaded the zip file to the IFS user home directory.
On the IBM i machine, I used the CPYFRMARCF
command to unzip the zip file on the IFS, and the save file was extracted from the zip file at the IFS location same as the zip file i.e. User home directory.
The save file is located at the IFS path /home/AGDEV/sav1.FILE
and changed the extension from .FILE
to .SAVF
at the IFS location.
Now, I am not getting the steps that how to copy a save file from IFS to a library in QSYS.
Please follow these steps to copy the save file from IFS to the library.
The first step is to create a save file in your library using the CRTSAVF command.
CRTSAVF FILE(LIBNAME/SAVEFILENAME)
For example, if the library name is TESTLIB and the save file name is SAVF1 then the command formed would be
CRTSAVF FILE(TESTLIB/SAVF1)
Use the CPY command to copy the IFS save file to the QSYS library.
CPY OBJ(path/savefilename.savf)
TOOBJ(/qsys.lib/libname.lib/savefilename.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
For example, if the path is
/home/developer
, and save file name issavf1
, and the library where the save file is to be copied isTESTLIB
then the command formed would beCPY OBJ(/home/developer/savf1.savf)
TOOBJ(/qsys.lib/developer.lib/savf1.file)
FROMCCSID(*PCASCII) TOCCSID(37) REPLACE(*YES)
You can save a save file from IFS to a library using the following steps:
Create a save file
CRTSAVF TESTLIB/SAVF1
Use CPYFRMSTMF to copy save file from IFS to the library
CPYFRMSTMF FROMSTMF('/home/admin/savf1.savf')
TOMBR('/qsys.lib/testlib.lib/savf1.file')
MBROPT(*REPLACE) CVTDTA(*NONE)
Here
/home/admin/
is the ifs folder where the save file is located.You can later restore the object saved in the save file to the same library.
RSTOBJ OBJ(*ALL) SAVLIB(TESTLIB) DEV(*SAVF) SAVF(TESTLIB/SAVF1)
MBROPT(*ALL) ALWOBJDIF(*ALL)
Here,
SAVLIB
isTESTLIB
In your case, you can run theDSPSAVF TESTLIB/SAVF1
command based on your save file name and library and you will see the saved library name from where all the objects get saved inside the save file.You can follow the below steps to transfer a save file stored in an IFS folder into a save file within a library.
Create a save file in a library.
CRTSAVF FILE(libname/savfname)
On the IBM i command line, create an FTP connection to the current system you are on.
FTP systemname
You will be prompted for your
username
andpassword
. Once you enter those you have aFTP
prompt. Type thebin
command.bin
Then type the following command to change the naming format.
quote site namefmt 1
Then type the following command to transfer the save file from the IFS into your save file present in the library.
get /ifsfolder/savefilename.savf libname/savfname (replace
You are now able to see the content inside the
libname/savfname
save file object.