Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

COMPARE-ELEMENT

COMPARE-ELEMENT permits text members to be compared one record at a time, where the scope of the comparison operation can be defined with the RECORD-PART operand. The differences established are listed in a comparison log and in the comparison statistics. The members may be located in different libraries.

The COMPARE-ELEMENT statement is also executed even if only one of the comparison members is found in the specified libraries. This allows the counting of records in members.

If two members are compared with one another, LMS uses the terms primary member and secondary member. The user is free to select the new or the old member as the base member. LMS always considers the secondary member to be the base for the comparison. This means that LMS identifies missing records in the secondary member as inserted records and missing records in the primary member as deleted records.

The primary and secondary member base types may differ if text members are compared.

The COMPARE-PARAMETERS operand is used to define the type of comparison (formal or logical) and control logging (scope and format).

COMPARE-ELEMENT always produces comparison statistics in the internal memory C0. After execution of the statement, C0 is added to memory C1. Memory C0 is reinitialized before each COMPARE-ELEMENT statement. These memories can be output by means of the SHOW-STATISTICS statement.

ACTIVATE-USER-EXIT permits the member records to be accessed via a user program prior to the actual comparison.

 

COMPARE-ELEMENT

PRIMARY-ELEMENT = *LIB RARY -ELEM ENT (...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...)



|


*ALL(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


<composed-name 1..64 with-under with-wild(132)>(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|

,TYPE = *LMS-DEF AULT / *ALL / <alphanum-name 1..8 with-wild(20)>



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,EXCEPT-ELEMENT = * NONE / *ELEMENT(...)



|


*ELEMENT(...)



|



|

ELEMENT = *ANY (...) / <composed-name 1..64 with-under with-wild(132)>(...)



|



|


*ANY(...)



|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /



|



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|



|


<composed-name 1..64 with-under with-wild(132)>(...)



|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /



|



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|



|

,TYPE = *ANY / *LMS-DEFAULT / <alphanum-name 1..8 with-wild(20)>



|



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|



|


*INTERVAL(...)



|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|



|

,TO = *TODAY / <date 8..10 with-compl>



|



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|



|


*INTERVAL(...)



|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|



|

,TO = *TODAY / <date 8..10 with-compl>



|



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|



|


*INTERVAL(...)



|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|



|

,TO = *TODAY / <date 8..10 with-compl>

,SECONDARY-ELEMENT = *LIB RARY -ELEM ENT (...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *BY-SOUR CE (...) / *ALL(...) /



|





<composed-name 1..132 with-under with-wild-constr>(...)



|


*BY-SOURCE(...)



|



|

VERSION = *HIGH EST -EXIST ING / *BY-SOURCE / *ALL / *UPPER-LIMIT /



|



|




<composed-name 1..52 with-under with-wild-constr>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


*ALL(...)



|



|

VERSION = *HIGH EST -EXIST ING / *BY-SOURCE / *ALL / *UPPER-LIMIT /



|



|




<composed-name 1..52 with-under with-wild-constr>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


<composed-name 1..132 with-under with-wild-constr>(...)



|



|

VERSION = *HIGH EST -EXIST ING / *BY-SOURCE / *ALL / *UPPER-LIMIT /



|



|




<composed-name 1..52 with-under with-wild-constr>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|

,TYPE = *BY-SOUR CE / *LMS-DEFAULT / *ALL / <alphanum-name 1..20 with-wild-constr>

,COMPARE-PARAMETERS = *LMS-DEF AULT / *PARAMETERS(...)


*PARAMETERS(...)



|

RECORD-PART = *LMS-DEF AULT / *ALL / *PART(...)



|


*PART(...)



|



|

START = *LMS-DEF AULT / <integer 1..32764>



|



|

,LENGTH = *LMS-DEF AULT / *REST / <integer 1..32764>



|

,SPACES = *LMS-DEF AULT / *STD / *IGNORED / *RELEVANT



|

,INFORMATION = *LMS-DEF AULT / *MEDIUM / *MINIMUM / *MAXIMUM / *SUMMARY / *STATISTICS



|



|


|

/ *NONE



|

,LAYOUT = *LMS-DEF AULT / *COMPATIBLE / *COMPRESSED



|

,JOIN-ELEMENT-SETS = *LMS-DEF AULT / *NO / *YES

,TEXT-OUTPUT = *LOGGING-PAR AMETERS / *NONE / *SYSOUT / *SYSLST(...) / *EDT(...)


*SYSLST(...)



|

SYSLST-NUMBER = *STD / <INTEGER 1..99>


*EDT(...)



|

WRITE-MODE = *EXTEND / *REPLACE

,STRUCTURE-OUTPUT = *SYSINF / *NONE / <composed-name 1..255>(...)


<composed-name 1..255>>(...)



|

WRITE-MODE = *REPLACE / *EXTEND

PRIMARY-ELEMENT = *LIBRARY-ELEMENT(...)

Specifies the first comparison member (primary member).

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)
Specifies the library containing the primary member.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = <filename 1..54 without-vers>
Name of the library containing the primary member.

LIBRARY = *LINK(..)
The library assigned via a link name.

LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of a /ADD-FILE-LINK command prior to the LMS run.

ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...)
All members of the library or the name of the member used as the primary member are compared.

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /
<composed-name 1..24 with-under with-wild(52)>
Version of the primary member.

VERSION = *HIGHEST-EXISTING
The member with the highest existing version with reference to BASE is used as the primary member.

VERSION = *ALL
All versions are taken into account in the comparison.

VERSION = *UPPER-LIMIT
The highest possible version X’FF’ in the library under the specified TYPE and name is used as the primary member.

VERSION = <composed-name 1..24 with-under with-wild(52)>
Explicitly specifies the version of the member that is used as the primary member.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Prefix for the version selection. In conjunction with VERSION=*HIGHEST-
EXISTING, it is then possible to use a certain prefix to reference the highest existing version. BASE=*STD has the same effect as BASE=*. For further information concerning specification of the base, see "Version designations".

TYPE = *LMS-DEFAULT / *ALL / <alphanum-name 1..8 with-wild(20)>All types are taken into account in the comparison.

TYPE = <alphanum-name 1..8 with-wild(20)>

Type of the primary member.

USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Date given by the user.

USER-DATE = *ANY
The primary member has any date.

USER-DATE = *TODAY
The member with the current date is used as the primary member.

USER-DATE = <date 8..10 with-compl>
The member whose date is entered explicitly in the form [YY]YY-MM-DD is used as the primary member.

USER-DATE = *INTERVAL(...)
All members lying in the specified interval are used as primary members.

FROM = 1900-01-01 / <date 8..10 with-compl>
Beginning of interval.

TO = *TODAY / <date 8..10 with-compl>
End of interval.

CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Creation date of the member. For a description of the operands, see USER-DATE above.

MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Date of the last modification to the member. For a description of the operands, see USER-DATE above.

EXCEPT-ELEMENT = *NONE / *ELEMENT(...)
Specifies the members to be excluded from the above selection.

EXCEPT-ELEMENT = *NONE
No members are excluded, i.e. all members selected by ELEMENT are used as primary members.

EXCEPT-ELEMENT = *ELEMENT(...)
Specifies the members that are not to be used as primary members. A member is excluded when all the fields of the EXCEPT-ELEMENT structure that are not set to *ANY identify the member as a hit. If all the fields of the EXCEPT-ELEMENT structure are set to *ANY, then all members will be excluded.
For a description of the operands, see *LIBRARY-ELEMENT.

SECONDARY-ELEMENT = *LIBRARY-ELEMENT(...)

Specifies the second comparison member (secondary member). The member selected here is used as the base for the comparison.

LIBRARY = *STD / *BY-SOURCE / <filename 1..54 without-vers> / *LINK(...)Specifies the library containing the secondary member.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = *BY-SOURCE
The secondary member is contained in the same library as the primary member.

LIBRARY = <filename 1..54 without-vers>
Name of the library containing the secondary member.

LIBRARY = *LINK(..)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of a /ADD-FILE-LINK command prior to the LMS run.

ELEMENT = *BY-SOURCE(...) / *ALL(...) /
<composed-name 1..132 with-under with-wild-constr>(...)
Name of the member to be used as the secondary member.

VERSION = *HIGHEST-EXISTING / *BY-SOURCE / *ALL / *UPPER-LIMIT /<composed-name 1..52 with-under with-wild-constr>
Version of the secondary member.

VERSION = *HIGHEST-EXISTING
The member with the highest existing version with reference to BASE is used as the secondary member.

VERSION = *BY-SOURCE
The version of the secondary member is the same as the version of the primary member, or X’FF’ if this does not exist.

VERSION = *UPPER-LIMIT
The highest possible version X’FF’ in the library under the specified TYPE and name is used as the secondary member.

VERSION = <composed-name 1..52 with-under with-wild-constr>
Explicitly specifies the version of the member that is used as the secondary member.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Defines the base for the secondary member. For further information concerning specification of the base, see "Version designations".

ELEMENT = <composed-name 1..132 with-under with-wild-constr>(...)

Name of the member to be used as the secondary member.

VERSION = *HIGHEST-EXISTING / *BY-SOURCE / *ALL / *UPPER-LIMIT /<composed-name 1..52 with-under with-wild-constr>
Version of the secondary member.
For description of the operands, see above.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Defines the base for the target member. For further information concerning specification of the base, see "Version designations".

TYPE = *BY-SOURCE / *LMS-DEFAULT / *ALL /
<alphanum-name 1..20 with-wild-constr>
Type of the secondary member.

TYPE = *BY-SOURCE
The secondary member has the same type as the primary member.

COMPARE-PARAMETERS = *LMS-DEFAULT / *PARAMETERS(...)
Defines the comparison parameters. Also used to specify the type of comparison (formal or logical) and the scope and format of logging.

RECORD-PART = *LMS-DEFAULT / *ALL / *PART(...)
Defines the comparison area in the record.

RECORD-PART = *ALL
The entire record is compared.

RECORD-PART = *PART(...)
Area specification for the part of the record to be compared.

START = <integer 1..32764>
Starting point of the area containing the part of the record to be compared. If no value is entered, the record is compared starting at the beginning.

LENGTH = *REST / <integer 1..32764>
Length of the area in the record to be compared. If no value is entered, the record is compared starting at the beginning.

SPACES = *LMS-DEFAULT / *STD / *IGNORED / *RELEVANT
Handling of space characters in the record.

SPACES = *STD
Has the same effect as *IGNORED for text members, otherwise as *RELEVANT.

SPACES = *IGNORED
Logical comparison. The comparison fields are compared one character at a time; spaces are ignored.

SPACES = RELEVANT

Formal comparison. The comparison fields are first checked for matching length. If the lengths match, the fields are compared in their entirety. If the lengths differ, the records are logged as being non-matching.

INFORMATION = *LMS-DEFAULT / *MEDIUM / *MINIMUM / *MAXIMUM / *SUMMARY / *STATISTICS / *NONE
Scope of logging.

INFORMATION = *MEDIUM
Standard comparison log. The comparison range of non-matching records is logged in its entirety. With matching records, only range specifications (record numbers) are logged. The comparison statistics are output.

INFORMATION = *MINIMUM
Minimum comparison log. For matching and non-matching records, only range specifications (record numbers) are logged. The comparison statistics are output.

INFORMATION = *MAXIMUM
Detailed comparison log.
All records are logged.
The comparison statistics are output.

INFORMATION = *SUMMARY
No comparison log. Only the comparison statistics are output.

INFORMATION = *STATISTICS
No comparison log. The comparison statistics are output in compressed form. The output is designed for lines with a length of 132.

INFORMATION = *NONE
No logging (no comparison log, no comparison statistics).
*NONE is meaningful only when the SHOW-STATISTICS statement is used.

LAYOUT = *LMS-DEFAULT / *COMPATIBLE / *COMPRESSED
Logging format.

LAYOUT = *COMPATIBLE
The comparison log is output in standard format. This format is compatible with earlier LMS versions.

LAYOUT = *COMPRESSED
The comparison log is output in a compressed format.

JOIN-ELEMENT-SETS = *LMS-DEFAULT / *NO / *YES
Defines the member set to be compared.

JOIN-ELEMENT-SETS = *NO
Only the primary members and the secondary members determined through construction are used for the comparison.

JOIN-ELEMENT-SETS = *YES

All primary and secondary members are used for the comparison.

TEXT-OUTPUT = *LOGGING-PARAMETERS / *NONE / *SYSOUT / *SYSLST (...) / *EDT (...)
Controls the log output.

TEXT-OUTPUT = *LOGGING-PARAMETERS
The log is output to the output medium specified with MODIFY-LOGGING-PARAMETERS TEXT-OUTPUT=.

TEXT-OUTPUT = *NONE
The log output is suppressed, apart from error messages.

TEXT-OUTPUT = *SYSOUT
The output is written to SYSOUT.

TEXT-OUTPUT = *SYSLST(...)
The output is written to SYSLST.

SYSLST-NUMBER = *STD / <integer 1..99>
Determines the SYSLST file to which the output is to be written.

SYSLST-NUMBER = *STD
The system file SYSLST is used.

SYSLST-NUMBER = <integer 1..99>
The system file with the specified number from the set SYSLST01 through SYSLST99 is used.

TEXT-OUTPUT = *EDT(...)
Output is to the work file 9 of EDT. If an error occurs during log output, then the system switches to the default output stream (SYSOUT).

WRITE-MODE = *EXTEND / *REPLACE
Write mode of the output in relation to the contents of work file 9.

WRITE-MODE = *EXTEND
If data exists in work file 9, the output will be added to this data. If there is no data in the file, the output will be written at the beginning of the file.

WRITE-MODE = *REPLACE
The output will be written at the beginning of work file 9. Any data that is already in the file will be replaced.

STRUCTURE-OUTPUT = *SYSINF / *NONE / <composed-name 1..255>(...)

Structured output.

STRUCTURE-OUTPUT = *SYSINF
The structured output is placed in the SYSINF stream assigned by /ASSIGN-STREAM (see the “SDF-P“ manual [12 (Related publications)]).

STRUCTURE-OUTPUT = *NONE
No structured output.

STRUCTURE-OUTPUT = <composed-name 1..255>(...)
Specifies the S variable in which the structured output is to be placed. This variable must have been declared as a dynamic list variable.
(Command: DECLARE-VARIABLE NAME=...(TYPE=*STRUCTURE),MULTIPLE-ELEMENTS=*LIST)

WRITE-MODE = *REPLACE / *EXTEND
Specifies whether the list variable is to be overwritten or extended.

WRITE-MODE = *REPLACE
Overwrites the old contents of the list variable.

WRITE-MODE = *EXTEND
Appends the new list members to the existing list.

Statement return code

(SC2)

SC1

Maincode

Meaning


2
2
2

0
0
0
0
1
32
64
64
64
64
130
130

CMD0001
LMS0129
LMS0201
LMS0313
CMD0230
LMS1002
LMS0302
LMS1003
LMS1004
PLA0229
LMS0041
LMS0412

No error
Statement aborted by user
Only the comparison range is logged
Overflow in statistic counter
Syntax error
Internal error
Member not found
Error during wildcard processing with at least one member or file
Other error
No access right for the member
System address space exhausted
Member locked

Notes

  • The INFORMATION operand has no influence on the structured output.

  • A list member is generated for each comparison of two members. The individual variable members are described in chapter "Format of LMS output in S variables" (8 Format of LMS output in S variables).

  • In the comparison statistics, the maximum value for element-count fields is 99,999. For line-count fields, it is 999,999,999. If the 9-digit limit overflows, the message LMS0313 will be shown and the affected counters will continue counting modulo 109.

Required access rights

For PRIMARY-ELEMENT:


Read authorization for LIBRARY and ELEMENT

For SECONDARY-ELEMENT:


Read authorization for LIBRARY and ELEMENT

Example

The members “TEST1” from libraries BIBU and PLIB are compared. The comparison area comprises the 5th through 30th bytes of the member record.

/ADD-FILE-LINK FILE=BIBU;LINK-NAME=LIB%
/START-LMS
//OPEN-LIBRARY LIBRARY=PLIB
//COMPARE-ELEMENT PRIMARY-ELEMENT=*LIB-ELEM(ELEM-TEST1,TYPE=S),-
               SECONDARY-ELEMENT=*LIB-ELEM(LIB=*LINK=LIB5)),-
               COMPARE-PARAMETERS=*PARAMETERS(INFORMATION=*MAXIMUM,-
               RECORD-PART=*PART(START=5;LENGTH=26))
...
//END