The CMPSECT process statement
compares multiple sections from one sequential data set or PDS member to
another sequential data set or PDS member.
It is not valid for a PDS group
comparison of more than one member. It is functionally similar
to CMPLINE but allows you to divide the input into
one or more sections for subsequent comparison or searching.
A section ID name is needed to associate all keyword
operands to a particular section.
Thus, multiple sections of the input can be compared (or searched)
in a single execution of SuperC.
Compare Types: LINE, WORD, and Search
Note: - CMPSECT is not supported for CMS.
- Keywords OTOP and OBTM are invalid for Search.
>>-CMPSECT--section_ID------------------------------------------>
.---------------------------------------.
V |
>----+-TOP------+--+-line_number---------+-+-------------------><
+-NTOP-----+ '-| String operands |-'
| (1) |
+-OTOP-----+
+-BTM------+
+-NBTM-----+
| (1) |
'-OBTM-----'
String operands
|--,--'--search_string--'--+-------------------------------------------+--|
'-,--start_column--+----------------------+-'
'-:--last_start_column-'
Notes:
- Invalid for Search-For.
- section_ID
- A character string identifier (up to 8 alphanumeric
characters, no embedded spaces, can start with a numeric)
relating to a section (group of lines).
It allows multiple keywords to be associated with the same section.
- keyword
- The keyword may have one of the following values:
- TOP
- Top. Defines the beginning line in the
new (or search) file and old compare section.
Means the same as NTOP and OTOP.
- NTOP
- New Top. Defines the beginning line in the new (or
search) section.
- OTOP
- Old Top. Defines the beginning line in the old section.
- BTM
- Bottom. Defines the ending line in the new
(or search) file
and old compare section. Means both NBTM and OBTM.
- NBTM
- New Bottom. Defines the ending line in the new (or
search) section.
- OBTM
- Old Bottom. Defines the ending line in the old compare
section.
- line_number
- The line number associated with the keyword.
- string
- A character or hexadecimal string enclosed within apostrophes.
For one embedded apostrophe, use two consecutive apostrophes ('').
- start_column
- The column in or after which the search_string
must start.
- last_start_column
- The last column in which the search_string may start.
Must be separated from the start_column by a colon.
Note: If a "top" condition is not found (for example, a pattern is incorrect),
the compare continues but normally reports zero lines processed
for this data set.
- Example
- Description
- CMPSECT SECT01 TOP 25 BTM 50
- Compares lines 25 through 50 in both data sets or members.
- CMPSECT SECT02 NTOP 60 NBTM 70CMPSECT SECT02 OTOP 65 OBTM 75
- Compares lines 60 through 70 in the new data set to lines
65 through 75 in the old data set.
- CMPSECT SECTX TOP 'PART1:',2:10CMPSECT SECTX BTM 'END PART1:',2:10
- Starts the comparison of both data sets when SuperC detects the
string "PART1:"
starting in columns 2 through 10 and ends the
comparison when SuperC detects the string
"END PART1:"
starting in columns 2 through 10.
- CMPSECT SECTY NTOP 'PART2:',2:10
CMPSECT SECTY OTOP 'PART2:',6:20
CMPSECT SECTY BTM 'END PART2:
- Compares a section in the new data set to a section in the old data
set. The section in the new data set begins with the string
"PART2:" in columns 2 through 10 and ends with the string
"END PART2:" in columns 2 through 10. The section in the
old data set begins with the string "PART2:" in columns 6
through 20 and ends with the string "END PART2:" in columns
2 through 10.
Note: All the previous statements could be combined to compare
multiple sections of the new and old data sets.