$GunZip
Decompress a longstring with GUNZIP
Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $GunZip function is Gunzip.
This function extracts information from a GZIP-format longstring.
The $GunZip function accepts two or three arguments and returns a longstring result.
Syntax
%lstrc = $GunZip(%lstr, type, [option])
%lstrc is the returned longstring.
The first argument, the longstring to be decompressed, is required. The string must be in GZIP format.
The second argument is a string indicating what information should be extracted from the GZIP-format longstring. This argument is optional; if it is not specified, DATA is assumed, and the longstring is decompressed into the result longstring. Valid options and their meanings are:
Options
| DATA | Indicates that the data in the GZIP longstring is extracted. This is the default. |
|---|---|
| TIME | Indicates that the date and time, known as the "modification time," is returned (in the form YYYY-MM-DD HH:MI:SS). |
| NAME | Indicates that the internal name of the GZIP entity is returned in the result. If no internal name is present, the null string is returned. |
The third argument is an optional string that controls the decompression method. [Introduced in Model 204 version 8.0]
| SOFTWARE | Forces the use of software decompression, bypassing the DFLTCC hardware instruction even when it is available on the processor (IBM z15 and above). This can be useful for diagnostic purposes or when byte-for-byte reproducibility with pre-8.0 behavior is required. |
|---|
If the third argument is omitted, hardware decompression is used automatically when DFLTCC is available, falling back to software decompression on older processors.
Usage notes
- If an invalid option is passed, or if compression is not enabled for the current run, the request is cancelled.
- The NCMPBUF parameter must be set by User 0 before the $GZip function can be used. If $GunZip is called with NCMPBUF = 0, the request is cancelled.
Examples
In the following example, %ls is set to the uncompressed version of the given string The DATA value default is implied, since no second argument is given.
%ls = $GunZip(%lsgz)
In the following example,
%dt is set to the last modification date and time of the file contained in the GZIP longstring.
%dt = $GunZip(%lsgz, 'TIME')
The following example forces software decompression:
%ls = $GunZip(%lsgz, 'DATA', 'SOFTWARE')
Note: GZIP-format files can be created with the function $GZip as well as other file compression utilities.
Products authorizing $GunZip
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility