|
Hi, *PLEASE* don't quote back the entire digest when you reply. Just quote back the part of the message that you're replying to. Thanks! My answer is below. [SNIP] > I can easily do it on PC platform but wondering if there is any utility or > functionality within OS/400 which can help us to do what we are trying to > do. Meaning save the disk space by compressing it and also be able to > recover data from compress mode within seconds. Do you mean something similar to the .ZIP capability on the PC? There are several similar utilities available for OS/400. [SNIP] > Any idea how to solve this issue? It's all regular data (numbers/strings). > For one order we have 100s of files and there are 100s of fields in each one > of them. Don't ask why we have so many files and fields. (FYI: It's all > custom development of many years). We would like to compress this data by > order number so that we can easily retrieve it. [SNIP] Here's a few ideas: 1) Put each file into a compressed save file. This capability is built into OS/400. To compress: CRTSAVF FILE(SAVF0001) SAVOBJ OBJ(FILE0001) LIB(MYLIB) DEV(*SAVF) SAVF(MYLIB/SAVF0001) + DTACPR(*YES) DLTF MYLIB/FILE0001 To decompress: CHKOBJ OBJ(MYLIB/FILE0001) OBJTYPE(*FILE) MONMSG MSGID(CPF9801) EXEC(DO) RSTOBJ OBJ(FILE0001) SAVLIB(MYLIB) DEV(*SAVF) + SAVF(MYLIB/SAVF0001) ENDDO 2) Use the JAR utility that comes with Java to compress the data. This creates .ZIP files just like the PC utilities. Not sure how well it works with OS/400 data files, though you could experiment. These are a QShell commands, run using the STRQSH command if you want to put it into a CL program or run it from QCMDEXC, etc to compress: mkdir /archives cd /qsys.lib/mylib.lib/myfile.file jar cMf /archives/file0001.zip mymember.mbr rm -r /qsys.lib/mylib.lib/myfile.file to decompress: system "crtpf mylib/myfile" cd /qsys.lib/mylib.lib/myfile.file jar xf /archives/file0001.zip mymember.mbr WARNING: This process treats the files like PC-style stream files and therefore you will lose any OS/400-specific information in the object and member descriptions. (Save files do not have this problem) 3) Get the GNU GZIP utility for OS/400. GZIP is an open-source file compression utility commonly used on Linux, FreeBSD, and similar systems. It does a better job, IMHO, of compression than .ZIP does but will have the same problem with losing description info. The OS/400 port can be found here http://www-1.ibm.com/servers/enable/site/porting/iseries/overview/gnu_utilities.html Again, these are QShell commands. To compress: cd /qsys.lib/mylib.lib/myfile.file gzip -9c mymember.mbr > /archives/mymember.gz rm -r /qsys.lib/mylib.lib/myfile.file to decompress: system "crtpf mylib/myfile" gzip -dc /archives/mymember.gz > /tmp/mymember.mbr cd /qsys.lib/mylib.lib/myfile.file cp /tmp/mymember.mbr mymember.mbr 4) As someone else suggested already, there's a native PKZIP software for OS/400. You could purchase that and use it...
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.