Compare disk files
Component: | BS2000 |
Functional area: | File processing |
Domain: | FILE |
Privileges: | STD-PROCESSING |
Function
The COMPARE-DISK-FILES command compares two disk files block by block (PAM) or record by record (SAM, ISAM) and informs the user of the result of the comparison.
The files can reside on public volumes, Net-Storage volumes or private disks. Permanent files, temporary files or work files can be compared.
Entire file generation groups cannot be compared, although individual file generations can.
SAM node files, like SAM files on public volumes, are compared record by record. When the data are read, the Net-Client converts them from the net coded character set to the coded character set. This means that the comparison is based on the coded character set. As a result, two SAM node files may be regarded as equal despite differences in the net coded character sets.
The files to be compared must be identical with respect to the following properties:
Access method (FILE-STRUCTURE)
Block format (BLOCK-CONTROL-INFO)
The default BLOCK-CONTROL-INFO=*IGNORE-ATTRIBUTE also permits different block formats.Coded character set (CODED-CHARACTER-SET)
For SAM files:
REC-SIZE when REC-FORM=F
For ISAM files:
REC-SIZE when REC-FORM=F
Properties of the ISAM key (KEY-LEN, KEY-POS, LOG-FL-LEN, VAL-FL-LEN)
Properties of the secondary key (KEY-LEN, KEY-POS, DUPKEY) for NK-ISAM
- For PAM files:
- Blocking factor (BUFFER-LENGTH)
- Number of occupied PAM pages (HIGHEST-USED-PAGE)
The command will be rejected for files with one of the following properties:
The file is empty.
The file is open.
The file is locked (e.g. SECURE lock)
The REPAIR-NEEDED or NO-DMS-ACCESS label is set.
PLAM libraries are PAM files and are compared block by block. The utility routine "LMS" [21] permits a comparison at member level.
The TPCOMP2 utility routine is available to compare tape files, see the “Utility Routines” manual [9].
Format
COMPARE-DISK-FILES |
FILE-NAME1 = <filename 1..54> ,FILE-NAME2 = <filename 1..54> ,BLOCK-CONTROL-INFO = *IGNORE-ATTRIBUTE / *INCLUDE-ATTRIBUTE ,PAMKEY-USER-INFO = *INCLUDE / *IGNORE |
Operands
FILE-NAME1 = <filename 1..54>
Name of the first file which is to be compared.
FILE-NAME2 = <filename 1..54>
Name of the second file which is to be compared.
BLOCK-CONTROL-INFO = *IGNORE-ATTRIBUTE / *INCLUDE-ATTRIBUTE
The files' block format is included in the comparison (*INCLUDE-ATTRIBUTE) or ignored (*IGNORE-ATTRIBUTE).
PAMKEY-USER-INFO = *INCLUDE / *IGNORE
Only relevant for PAM files with BLOCK-CONTROL-INFO=*PAMKEY:
The user information in the PAM key is included in the comparison (*INCLUDE) or ignored (*IGNORE).
Output information about the file comparison
If the files are identical, message DMS0630 is issued.
If the files are not identical, message DMS0631 is issued. Depending on the file type, further information is output:
For SAM files:
Message DMS0632 displays the number of the record in which the first difference occurs. The block and record numbers within the data block are also displayed for this position.For ISAM files:
Message DMS0633 displays the number of the record in which the first difference occurs.For PAM files:
Message DMS0634 displays the number of the 2K data block and the byte number within this data block in which the first difference occurs.
If PAMKEY-USER-INFO=*INCLUDE is used and the first difference in the user information is found in the PAM key, message DMS0635 displays the number of the associated 2K data block.
Return codes
(SC2) | SC1 | Maincode | Meaning |
---|---|---|---|
0 | DMS0630 | Command executed without error. The files are identical. | |
0 | DMS0631 | Command executed without errors. The files are not identical. | |
1 | CMD0202 | Syntax or semantic error in file name | |
32 | DMS05C7 | Unexpected internal error in DMS | |
64 | CMD0102 | Interrupted by K2 key | |
64 | CMD0216 | Command privilege missing | |
64 | DMS0501 | File catalog not available | |
64 | DMS0512 | File catalog not found | |
64 | DMS051B | User ID not in pubset | |
64 | DMS051C | User not authorized to access pubset | |
64 | DMS0535 | Specified file not shareable | |
64 | DMS0585 | An error was detected during catalog processing or during multiprocessor processing | |
64 | DMS05FC | User ID not in home pubset | |
64 | DMS0636 | File attributes do not permit a comparison | |
64 | DMS0684 | File does not exist | |
130 | DMS0524 | System address space full | |
130 | DMS0582 | File is currently locked or in use and cannot be processed | |
130 | DMS0594 | Not enough virtual memory available |