UNLOAD command

The UNLOAD command copies a specified generation of a table to a sequential output dataset.


TBL=(table name)
TTYPE=(table name conversion – blank/V)
LIB=(library name)
GEN=(generation number)
PSWD=(read password/write password)
STARTREC=(row number at which unloading starts)
RECCOUNT=(maximum rows to be unloaded)
STARTBYT=(byte number in row at which unloading starts);

Required keyword

Required keyword


The specified generation is written to the dataset connected to the DD statement named DDNAME in the TO parameter field. STARTREC and RECCOUNT can be used to limit the rows unloaded; STARTBYT can be used to control the portion of each row unloaded.

If the record length is greater than the row size, the remainder of the record is filled with spaces.

If the record length of the dataset defined by the TO keyword is less than the ROWSIZE of the table, the unloaded rows will be truncated to the record length of dataset.

The number of unloaded rows is displayed.

Hash tables will not be in key sequence when they are unloaded. Empty rows will be dropped.