CMPAT - Compatibility
In the IBM z/OS environment, `CMPAT` (Compatibility) is a parameter primarily used within `DFSMS` (Data Facility Storage Management Subsystem) constructs, specifically `DATACLAS` (Data Class) and `STORCLAS` (Storage Class) definitions. It dictates how certain dataset attributes, most notably `RECFM` (Record Format), are handled during dataset allocation, determining whether `JCL` or program-specified attributes override `SMS` policy definitions. CMPAT (Compatibility) is a COBOL compiler option used within IBM Enterprise COBOL for z/OS to control the level of language compatibility for a COBOL program. Its primary purpose is to allow programs written for older COBOL compilers, such as OS/VS COBOL or VS COBOL II, to be compiled and executed on newer compilers with minimal or no source code modifications.
Key Characteristics
-
- SMS Context:
CMPATis a keyword parameter defined withinDATACLASandSTORCLASdefinitions, which are integral parts of theDFSMSpolicy. - Record Format (
RECFM) Control: Its primary function is to control the precedence of theRECFMattribute during dataset allocation. - Parameter Values: Typically takes values of
YES(orY) orNO(orN). CMPAT=YES: Allows theRECFMspecified in theJCLor application program to override theRECFMdefined in theDATACLAS.CMPAT=NO: Enforces theRECFMspecified in theDATACLAS, overriding anyRECFMspecified in theJCLor program.- Dataset Allocation Impact: Directly influences the final attributes of a new dataset, particularly for
sequentialandVSAMdatasets, ensuring attribute consistency or flexibility. - Policy Enforcement: When set to
NO, it acts as a strong policy enforcer, ensuring that datasets conform to the storage administrator's definedRECFMstandards.
- SMS Context:
Use Cases
-
- Migrating Legacy Applications: Setting
CMPAT=YESin aDATACLASallows older applications that hardcodeRECFMin theirJCLor programs to continue functioning without modification, respecting their specified record format. - Standardizing Dataset Attributes: For new development or modern applications, using
CMPAT=NOensures that all datasets allocated under a specificDATACLASadhere to a predefinedRECFM, promoting consistency and simplifying data management. - Preventing
RECFMMismatches:CMPAT=NOcan be used to prevent errors caused byRECFMmismatches betweenJCLandDATACLASdefinitions, ensuring data integrity and application stability. - Enforcing
VSAMDataset Standards: Can ensure thatVSAMdatasets (e.g.,KSDS,ESDS) are allocated with specificRECFMattributes required by the application or database system, regardless ofJCLspecifications.
- Migrating Legacy Applications: Setting
Related Concepts
CMPAT is tightly integrated with DFSMS and its core components, especially DATACLAS and STORCLAS. Its behavior is determined by ACS (Automatic Class Selection) routines, which select the appropriate DATACLAS based on dataset characteristics. It directly impacts how JCL parameters, particularly those related to DCB (Data Control Block) and DSORG (Dataset Organization), interact with SMS policies during dataset allocation. It fundamentally relates to RECFM (Record Format), a crucial dataset attribute defining how records are stored.
- Default to
CMPAT=NOfor New Datasets: For new applications and datasets, it is generally best practice to setCMPAT=NOin theDATACLASto enforceSMSpolicy and ensure consistent, standardized dataset attributes. - Use
CMPAT=YESJudiciously: ReserveCMPAT=YESfor specific legacy applications that cannot be easily modified, carefully documenting its usage and potential implications for data consistency. - Review
ACSRoutines: Ensure `