I need to save objects from multiple directories with the directory names and have not had any luck getting this to work. I am attempting to save the information to a save file. I need only the data with an extension of *.tif.
The directory structure is like this:
/abc/xyz/123-456-7777/1.psg
/abc/xyz/123-456-7777/1.tif
/abc/xyz/123-456-8888/1.psg
/abc/xyz/123-456-8888/1.tif
/abc/xyz/123-456-8888/2.psg
/abc/xyz/123-456-8888/2.tif
/abc/xyz/123-456-9999/1.psg
/abc/xyz/123-456-9999/1.tif
I want to save all the *.tif objects but not the *.psg objects. There are some additional extensions as well but if I can get the SAV to exclude the *.psg I should be able to figure out how to do the others.
I wish to end up with the data in the save file like this:
/abc/xyz/123-456-7777/1.tif
/abc/xyz/123-456-8888/1.tif
/abc/xyz/123-456-8888/2.tif
/abc/xyz/123-456-9999/1.tif
Software/Hardware used:
ASKED:
December 11, 2006 6:37 PM
UPDATED:
December 14, 2006 7:12 AM
If the directories and extension are always the same you should be able to hardcode a CL to do it this way.
SAV DEV(‘/QSYS.LIB/yourlib.LIB/yoursavf.FILE’) OBJ((‘/dir1/dir2/*.ext’)(‘/dir3/dir4/*.ext’))
You can have up to 300 obj entries in the list.
If you want to build it as a varible it might be easiest to build the entire command string and use
CALL PGM(*LIBL/QCMDEXC) PARM(&CMD 1000)
to run it.
I had considered the creation of a file to retrieve the specific entries but wanted to see if someone had an easier solution. I have about 17000 subdirectories and if I save everything I end up with a save file of 650 MB. The file is on a remote system and I need to transfer it to the local system. I don’t use the SAV command that often and wanted to make sure I did not overlook something.
I appreciate the suggestions.
With that many objects to move have you considered just FTPing the objects to the target location. Then you wouldn’t even need the save file.
Also if the target just needs to access the files you could setup a Symbolic link between the systems and not even move then but still have access from both system.
If all these files are on the IFS, it might be easier to map it as a windows drive and use something like Winzip to save a copy & move them over. Point it at the top level directory give it a wildcard match like *.png and tick the box to include all subdirectories. It won’t be in native OS/400 format but it might be a lot easier than using SAV (although harder to automate). It depends on whether this is a one-off or something you have to do every day.