Learn how iSeries document scanning, capture, distribution and workflow can save money, increase document security, and improve organization efficiency. Learn more at www.informdecisions.com
Popular keywords: as/400 forms - as400 forms - iseries forms - iseries reports - AS/400 reports - AS400 reports
As you know, there is a hardware compression available on the iSeries 400. However, do you know that there is also a software compression? Do you know that it is easy to use software compression? If you do not know these facts, read the following article to get more details and Nick Hobson will give this tip. 

In fact, simple terse and IBM LZ1 are two algorithms offered by IBM. IBM LZ1 is used in WinZip and pkzip and is IBM's patented implementation of the Lempel-Ziv algorithm. According to Nick Hobson’s experience, IBM LZ1 is better than simple terse. Therefore, he will cover IBM LZ1 here. 


Firstly, you must the address and length of the source and result strings, and the algorithm number to use compression. (1=Simple Terse, 2=IBM LZ1.) To find these details, go to a data structure, known as a template. Then, the address of the template is passed to the MI builtin function.

The compress function will populate the result field, and place the length of the compressed string in CompressLen while the decompress function will populate the result field, and place the length of the decompressed string in decompresslen. Remember that you do not need to provide algorithm number or the source length. The decompress function can determine these from the compressed string. Also, you make sure that you provide a long enough result field. In fact, this will not be a problem because normally you will know the original string length.

Source: search400
Design by Ly Dinh Themes - Cân điện tử | Blogger Theme by iSeries IBM i