Bob Butcher
asked on
how to move a save file from one as400 to another
I am configuring another as400 on our network - and soon our programmers will want to move objects in a save file from one system to another. can someone point me in the right direction on how to set this up?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A savefile may be copied to and from directories in the /root file system with CPYTOSTMF and CPYFRMSTMF. If a couple rules are followed, some automatic handling can be taken advantage of.
For example, if a savefile named MYSAVF exists in library MYLIB, it can be copied into a directory named /somedir/somesubdir with this command:
Of course, as with almost any streamfile, it can be moved or copied to any remote storage. The CPYTOSTMF/CPYFRMSTMF commands can copy directly to/from any network storage that is accessible to the user. Source or destination might be through /QNTC or /QFileSvr.400. It's not necessary to copy to/from a local IBM i directory first. The normal authentication rules apply.
I'd advise creating a test savefile and practicing copying in both directions until it all becomes clear. I keep a savefile named simply SAVF in my current library and a streamfile named savf.savf in my /home directory. They're both used often for my own convenience.
For example, if a savefile named MYSAVF exists in library MYLIB, it can be copied into a directory named /somedir/somesubdir with this command:
CPYTOSTMF FROMMBR( '/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE' ) TOSTMF( '/somedir/somesubdir/IFSSAVF.SAVF' ) STMFOPT( *REPLACE )
Copying from an IFS directory back into a savefile could use this command:CPYFRMSTMF FROMSTMF( '/somedir/somesubdir/IFSSAVF.SAVF' ) TOMBR( '/QSYS.LIB/MYLIB.LIB/MYSAVF.FILE' ) MBROPT( *REPLACE )
Rules to remember:- Use extension .SAVF for the streamfile name. The system knows it's a savefile by that extension.
- For the TOMBR() and FROMMBR() parameters, only the .FILE part of the file name is used. The .MBR part of the name should be left off.
Of course, as with almost any streamfile, it can be moved or copied to any remote storage. The CPYTOSTMF/CPYFRMSTMF commands can copy directly to/from any network storage that is accessible to the user. Source or destination might be through /QNTC or /QFileSvr.400. It's not necessary to copy to/from a local IBM i directory first. The normal authentication rules apply.
I'd advise creating a test savefile and practicing copying in both directions until it all becomes clear. I keep a savefile named simply SAVF in my current library and a streamfile named savf.savf in my /home directory. They're both used often for my own convenience.
ASKER