HASH

Synopsis

HELP:   Generation or check of one way hash values of input data
TYPE:   OBJECT
SYNTAX: HASH(ALGO=MD5/RIPEMD128/RIPEMD160/SHA1/SHA224/SHA256/SHA384/SHA512/SHA3-224/SHA3-256/SHA3-384/SHA3-512/CRC8/CRC16/CRC24/CRC32/CRC32C/CRC40/CRC64,CHECK.{},FORMAT=GNU/BSD/HEX/BIN,CUT=num,OUTPUT='str'/STDOUT/STDERR,MEMBER='str',CCSID='str'/DEFAULT/ASCII/EBCDIC/SYSTEM/LOCAL,BLKSIZ=num)

Description

The hash component can be used to generate and check hash values (checksums). This can be useful to verify data integrity of files after transmission or on a storage device.

If you do not specify the output filename, the output of this component is written to the log.

For the output file, all rules and replacements are valid which are described under "FILENAME HANDLING" above. For example:

   OUTPUT=STDERR                          ; is SYSOUT on z/OS
   OUTPUT='~.MYCHECK(HASH1)'              ; PDS on z/OS
   OUTPUT='<SYSUID>.MYCHECK2'             ; PS dataset on z/OS
   OUTPUT='~/mycheck3.txt'                ; Unix path name
   OUTPUT='<HOME>\\hashs\\mycheck4.txt'   ; Windows path name

By using the 'check' overlay, data can be verified against a previously computed hash value that can either be passed directly or from an input file. The result is written to output.

Passing an empty string or filename in the 'check' overlay implies only calculation of the hash without verification.

You can also specify the CCSID parameter. It indicates the CCSID of the check file and the output file. The check file is read once as binary and once as string, with optional character conversion. So, you can generate an ASCII check file on an EBCDIC machine without having to convert this file in a separate step.

The member name supports input output name mapping and can be used to define the file names written to the GNU or BSD formated checksum files. The default of such a member name at read is the original (source) name of the file. At write the target file name is used.

Arguments