REORG Reorganise Library/ISAM File

REORG lib-1 [, lib-2] [, par]

The specified library lib-1 (FMS/LMS/PLAM), or ISAM file is reorganised, in so far as all elements (records) are transfered to a temporary file, lib-2.

par :x: | vsn/device | PAD=nn | NR | DF[O] | SPACE=(xxxx,yyy)

:x: The reorganised library/temporary file is created on the specified PVS.

vsn/device The reorganised library/temporary file is created on the specified private volume.

Note:

If the temporary file is to be spread over multiple private disks, or if it should be created on any special medium, the following procedure should be used:

Create a file of a sufficient size on the required volume, using any name (with the exception of CFS.REORGFILE). Make this file known to CFS by issuing the following command: /FILE file,LINK=CFSREORG. From now on, any reorganisation will be executed using this file as the work file. This work file will not be deleted following the reorganisation, as is usually the case. The contents can be deleted with an /ERASE file,DATA command. The space reservation will remain.

nn optional PAD factor for the reorganised file. This parameter is only valid when reorganising ISAM files. PAD=nn can also ge given after :x: or vsn/device (separated by a comma).

NR No Release of free space. Space that has been allocated, but not yet used, is not released after the reorganisation. This space is available to the library or file for later use.

Standard: The free space is released.

DF[O] Defragment [Only]. Before copying back the temporary file, the space used by the original file is released by CFS issuing an /ERASE ,SPACE command, then the required space is requested anew. The number of extents of the original file should thus be reduced. The defragmentation is particularly effiecient if the temporary file is created on a different Pubset (REORG lib,:x:,DF).

DFO: Only the defragmentation will be performed. "Holes" in libraries or ISAM files will not be removed.

Standard: Defragmentation disabled for libraries and ISAM files, but enabled for all other files.

SPACE= Following a successful reorganisation, a FILE command with the specified SPACE parameter will be executed. In this way, surplus disk space can be released, and the secondary space allocation for the file can be simultaneously modified. (e.g. SPACE=(-9999,30) ).

Standard: free space is released. The secondary allocation is not amended.

Notes:

"Holes" created by the frequent erasure and creation of elements can be removed from libraries by using the REORG command. Following this command, the library will occupy less disk space.

If lib-2 is not specified, the temporary file created during the reorganisation is copied back to the original library, lib-1, and all unnecessary disk space is released with the command /FILE ...,SPACE=-9999. The temporary file is then erased.

If lib-2 is specified, then the reorganised library/ISAM file will be created with this name, and will not be copied back to the original file afterwards. In this case, the output file, lib-2 will also be optimised with respect to the extents by virtue of a /FILE lib-2, SPACE=(nn, nn) command issued before the reorganisation..

If the file list consists of elements of a library, the name of the library to be reorganised ( lib-1 ) can be omitted. In this case, the library whose elements are being displayed will be reorganised.