### SORTWKnn DD Statement Example Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=commands-creating-library This example demonstrates the syntax for a SORTWKnn DD statement, which is used for dynamically allocating sort work areas. The number of DD statements and the space allocated can be adjusted based on installation-specific requirements and the amount of sort work space needed. ```JCL //SORTWK01 DD SPACE=(CYL,(60)),UNIT=SYSALLDA ``` -------------------------------- ### MQFL FROMKEY and TOKEY Clause Example Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=feature-select-command-optional-clauses Illustrates the usage of FROMKEY and TOKEY clauses in MQFL to specify the starting and ending points for data processing based on field values. This example selects specific records from data sets using these clauses. ```MQFL SELECT MCDDSN, MCDVSN, MCDTLR, MCDDMIG FROM (RLS1.HSM.SPLIT.MCDS1 RLS1.HSM.SPLIT.MCDS2) USING DCD.MFL.MAPS(MCD) CREATE DCD.HSM.MCDPLAN1.FORMAT FROMKEY MCDDSN = 'DCD.' TOKEY MCDDSN = 'DCD.' WHERE MCHTYPE = X'00' AND MCDFLGS ON B'10000000' ORDER BY MCDDSN A ``` -------------------------------- ### AT-TLS Policy Rules Example for Inbound Server Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=configuration-step-11-enabling-tls-secured-connections-optional This example demonstrates the structure of AT-TLS policy rules for an inbound server STC. It defines rules for the server's identity, local port, cryptographic settings, and TLS version support. The example uses placeholders for user-specific values like Userid, STC Name, Port, and Keyring. ```text - Userid which is used to run STC - Name of STC - Secure port. PORTNUM parm in STC parameter - Name of RACF keyring which belongs to with server certificate. TTLSRule Server@Rule { Userid Jobname LocalPortRange Direction Inbound Priority 10 TTLSGroupActionRef Server@GrpAct TTLSEnvironmentActionRef Server@Env } TTLSEnvironmentAction Server@Env { HandshakeRole Server TTLSCipherParmsRef ServerCipherParams TTLSKeyRingParms { Keyring } TTLSEnvironmentAdvancedParms { ApplicationControlled Off TLSv1.2 On TLSv1.3 On } } TTLSGroupAction Server@GrpAct { TTLSEnabled On Trace 2 } TTLSCipherParms ServerCipherParams { V3CipherSuites TLS_AES_128_GCM_SHA256 V3CipherSuites TLS_AES_256_GCM_SHA384 V3CipherSuites TLS_CHACHA20_POLY1305_SHA256 V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 V3CipherSuites TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 V3CipherSuites TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 V3CipherSuites TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 V3CipherSuites TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA V3CipherSuites TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA V3CipherSuites TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 V3CipherSuites TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 V3CipherSuites TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 V3CipherSuites TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 V3CipherSuites TLS_DHE_RSA_WITH_AES_128_CBC_SHA V3CipherSuites TLS_DHE_RSA_WITH_AES_256_CBC_SHA V3CipherSuites TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 V3CipherSuites TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 } ``` -------------------------------- ### Example: EXPLORE command to select catalog aliases Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=sets-criteria-keyword-filters An example JCL snippet demonstrating the use of the EXPLORE command with the P-DSNAME filter to select aliases pointing to a specific user catalog. ```JCL EXPLORE CRIT(INC( - DSN EQ ** AND - UCAT EQ MASTERCATALOG AND - DS-TYPE EQ ALIAS AND - P-DSNAME EQ your_user_catalog ) ) - DSNLISTFILE(SYSPRINT) ONLY-BCS-DATA ``` -------------------------------- ### MQFL Plan for Data Selection Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=language-query-feature This example demonstrates defining an MQFL plan to select specific data fields from multiple sources, create a new dataset, and order the results. MQFL plans must start with 'PLAN plan-name' and end with 'END plan-name'. ```MQFL PLAN PLAN02 SELECT SGROUP-LOW,SPERCENT-OCC-LO FROM (HLQ.MONTHLY.SUM HLQ.WEEKLY.SUM) USING HLQ.CNTL(STGPSUM)) CREATE HLQ.STGP.WORK04.RAWLO ORDER DISTINCT BY SGROUP-LOW A, SPERCENT-OCC-LO A END PLAN02 PLAN PLAN04 SELECT SGROUP-LOW,SPERCENT-OCC-LO FROM HLQ.STGP.WORK04.RAWLO USING DEFERRED CREATE HLQ.STGP.WORK04.LOW.CSV ORDER DISTINCT BY SGROUP-LOW A END PLAN04 ``` -------------------------------- ### CREATE Clause Example Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=feature-select-command-required-clauses An example of the CREATE clause used to define a new output dataset. This clause will delete and redefine the specified dataset. It is important to note the JCL requirements for RECFM, LRECL, and BLKSIZE based on specified options. ```JCL CREATE HLQ.DVLP.STGP.TR01MODL.CSV ``` -------------------------------- ### JCL: Cross-System Secondary Started Tasks (Default Jobname Characters) Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=guide-reorg-reorganize-open-bcs This JCL example demonstrates the simplest method for reorganizing a catalog across multiple systems. It configures the CKMJMAIN task to initiate secondary REORG jobs as started tasks on secondary systems, using default jobname characters. ```JCL //J001 JOB ,NAME,MSGCLASS=X //* /*JOBPARM S=SYSA //* //REORG EXEC PGM=CKM00010,REGION=0M //STEPLIB DD DISP=SHR,DSN=HLQ.SCKMLOAD //INI DD DISP=SHR,DSN=HLQ.SCKMPARM(CKMINI) //BKUPDD1 DD DSN=HLQ.BKUP1,UNIT=SYSDA, // DISP=(,CATLG),SPACE=(CYL,(100,100),RLSE) //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSIN DD * REORG BCS (CRTUCAT.TESTCAT1) - NOREPLY - OFILE(BKUPDD1 ) - SYSTEM( DEFAULT - STC - JOBNAME(DUDLEY%) - JOBCHAR(*) - MSGCLASS(A) - ) - SYSTEM( SYSNAME(*) ) /* // ``` -------------------------------- ### REORG Control Statement: Example for Shared Catalog Systems Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=guide-reorg-reorganize-open-bcs This example demonstrates how to use multiple SYSTEM keywords to specify all systems sharing a catalog. A maximum of 64 SYSTEM keywords are allowed, including one for the primary job and up to 63 for secondary jobs. ```JCL SYSTEM(SYSNAME(SYSA)) SYSTEM(SYSNAME(SYSB)) SYSTEM(SYSNAME(SYSC)) SYSTEM(SYSNAME(SYSD)) ``` -------------------------------- ### Convert GDG Bases to GDG-EXTENDED Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=catalog-alter-gdg This example simulates the conversion of all GDG bases for a specific application (HLQ1) to the GDG-EXTENDED format. It utilizes the SIMULATE, INCLUDE-GDG, INCLUDE-ATTR, and NEW-ATTR parameters. ```JCL ALTER GDG - SIMULATE - INCLUDE-GDG(HLQ1.**) - INCLUDE-ATTR(NOEXTENDED) - NEW-ATTR(EXTENDED) ``` -------------------------------- ### Example FIELDS Syntax for Catalog Management Attributes Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=guide-report-design-custom-reports This snippet illustrates the syntax for the FIELDS function in IBM Catalog Management, showing how to define optional attributes such as display length (DISPLEN) and column headers (COLHDR). It is a common pattern for configuring data set display properties. ```example FIELDS(DSN (DISPLEN(30) COLHDR('Data set', 'Name') ) ``` -------------------------------- ### Investigate Damaged GDG Structure Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=catalog-alter-gdg This example simulates an investigation into a severely damaged GDG structure. It uses SIMULATE, RECLAIM, INCLUDE-GDG, BCS, ALLOW-GDS-SCRATCH, and PRINT(DATA) parameters. ```JCL ALTER GDG - SIMULATE - RECLAIM - INCLUDE-GDG(HLQ1.BROKEN.GDGBASE) - BCS(CATALOG.APPL1) - ALLOW-GDS-SCRATCH(NO) - PRINT(DATA) ``` -------------------------------- ### REORG Control Statement: Combining Keywords for Shared Catalog Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=guide-reorg-reorganize-open-bcs This example shows a complete REORG control statement for a shared catalog, including the SYSTEM keywords to designate all participating systems. The order of the SYSTEM keywords does not matter. ```JCL REORG BCS(USERCAT.UCAT1) - ...(other REORG keywords) SYSTEM(SYSNAME(SYSA)) - SYSTEM(SYSNAME(SYSB)) - SYSTEM(SYSNAME(SYSC)) - SYSTEM(SYSNAME(SYSD)) ``` -------------------------------- ### MQFL FORMAT OPTIONS Examples Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=feature-select-command-optional-clauses Demonstrates various formatting options available in MQFL, such as date formats, compression, dictionary usage, and string handling. These options control how output data is structured and stored. ```MQFL 1 DATE = 194001.BLANKS 1 DATE = 194001.AST 1 DATE = YYYYDDD 1 DATE = DDpMMpYYYY 1 DATE = MMpDDpYYYY 1 DATE = YYYYpMMpDD 1 COMPRESS 1 NOCOMPRESS 1 DICTIONARY 1 NODICTIONARY 1 STRING 1 NOSTRING 1 TOTALSONLY 1 TOTALS 1 NOTOTALS 7? DUPLICATE(/ field ) 7? FBblksize ``` -------------------------------- ### JCL: Cross-System Secondary Started Tasks (Explicit Jobname Characters) Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=guide-reorg-reorganize-open-bcs This JCL example explicitly specifies jobname characters for secondary started task REORG jobs on specific systems. Systems not explicitly defined will receive automated jobname characters. It also shows how to run a secondary REORG job as a batch job on an isolated system. ```JCL //J002 JOB ,NAME,MSGCLASS=X //* /*JOBPARM S=SYSA //* //REORG EXEC PGM=CKM00010,REGION=0M //STEPLIB DD DISP=SHR,DSN=HLQ.SCKMLOAD //INI DD DISP=SHR,DSN=HLQ.SCKMPARM(CKMINI) //BKUPDD1 DD DSN=HLQ.BKUP1,UNIT=SYSDA, // DISP=(,CATLG),SPACE=(CYL,(100,100),RLSE) //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSIN DD * REORG BCS (CRTUCAT.TESTCAT1) - NOREPLY - OFILE(BKUPDD1 ) -; SYSTEM( DEFAULT - STC - JOBNAME(DUDLEY%) - JOBCHAR(*) - MSGCLASS(A) - ) -; SYSTEM( SYSNAME(SYSA) JOBCHAR(A) ) -; SYSTEM( SYSNAME(SYSB) JOBCHAR(B) ) - SYSTEM( SYSNAME(SYSC) JOBCHAR(C) ) -; SYSTEM( SYSNAME(SYSD) BATCH) - SYSTEM( SYSNAME(*) ) /* // ``` -------------------------------- ### COBOL Comment Line Example Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=language-mqfl-data-definition This example shows how to define a comment line in COBOL. Comments are denoted by an asterisk (*) in the seventh column and are used for explanatory purposes within the code. ```COBOL * This is example record ``` -------------------------------- ### RECOVER BCS/DSN DEFINE USERCATALOG Output Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=commands-creating-library When SIMULATE(DEFINE) is specified for RECOVER BCS or RECOVER DSN, the GENDEFCC DD statement captures generated DEFINE USERCATALOG commands. It must be a non-VSAM sequential data set (DSORG=PS) with LRECL=80. ```JCL //GENDEFCC DD DSN=dsname,DISP=(,CATLG), // UNIT=SYSALLDA,SPACE=(TRK,(1,1)) ``` -------------------------------- ### COBOL Record Start Definition Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=language-mqfl-data-definition Illustrates the beginning of a COBOL record definition. The '01' level number signifies the start of the record, followed by the group name and a period. This defines the entire record structure. ```COBOL 01 FB80-TEST-RECORD. ``` -------------------------------- ### IDCAMS DELETE NOSCRATCH Command Generation Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=files-generate-bcs-unload Creates DELETE NOSCRATCH commands. Specific behaviors apply: GDG objects get FORCE but not NOSCRATCH; Alias objects do not get NOSCRATCH. For BCS, EXPORT DISCONNECT is generated instead of DELETE. ```JCL //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DELETE (dataset.name) NOSCRATCH /* ``` -------------------------------- ### EXPLORE FILESYSTEM Command Syntax Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=systems-syntax Defines the primary syntax for the EXPLORE FILESYSTEM command, which is used to explore file systems. It specifies options like CRITeria, INClude, EXClude, and various listing functions. ```z/OS JCL/REXX EXPLORE FILESYSTEM? CRITeria(+ INClude( + %Filter expression )?+ EXClude(+ %Filter expression )) LISTFILE(ddname) LIST(dsn) ICF-LISTFILE(ddname) ICF-LIST(dsn) EXT-FLAT(dsn) EXT-FLATFILE(dsname) ``` -------------------------------- ### WTO_Request_Catalog_Backup System Command Syntax Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=commands-wto-request-catalog-backup-action This section shows how to use the WTO_Request_Catalog_Backup command within situations or workflow policies. It demonstrates direct argument passing and attribute substitution for dynamic argument supply. ```shell WTO_REQUEST_CATALOG_BACKUP \ [KRN_LAST_CATALOG_BACKUP.BCSNAME] [KRN_LAST_CATALOG_BACKUP.LBKPNAME] ``` ```shell WTO_REQUEST_CATALOG_BACKUP \ [&{KRN_LAST_CATALOG_BACKUP.BCSNAME}] \ [&{KRN_LAST_CATALOG_BACKUP.LBKPNAME}] ``` ```shell WTO_REQUEST_CATALOG_BACKUP \ [&WaitOnSituation:KRN_LAST_CATALOG_BACKUP.BCSNAME] \ [&WaitOnSituation:KRN_LAST_CATALOG_BACKUP.LBKPNAME] ``` -------------------------------- ### MQFL WHERE Clause - Single Predicate Examples Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=feature-select-command-optional-clauses Provides examples of single predicates used in the MQFL WHERE clause for filtering data. These include comparisons with literals, LIKE and ACSLIKE patterns, numeric and date comparisons, and IN clauses. ```MQFL WHERE SGROUP = 'HSMML1' WHERE DSNAME LIKE 'MYDSN.%' WHERE DSNAME ACSLIKE 'MYDSN.**' WHERE EXTENTS > 1 WHERE MIGDATE > *+7 WHERE MIGDATE > 2009200 WHERE MIGDATE > BACKDATE WHERE VOLSER IN (‘PRD001', ‘PRD002') WHERE BLKSIZE IN (80, 132, 133) WHERE DSNFLAGS ON B'10000000' or WHERE DSNFLAGS ON X'80' ``` -------------------------------- ### MQFL WHERE Clause - Compound Predicate Examples Source: https://www.ibm.com/docs/en/catalog-management/2.6.0/index_topic=feature-select-command-optional-clauses Demonstrates the use of compound predicates in the MQFL WHERE clause, combining multiple conditions using AND, OR, and NOT operators, along with parentheses for logical grouping. These examples showcase complex data filtering scenarios. ```MQFL WHERE MIGDATE > BACKDATE AND VOLSER = '123456' WHERE MIGDATE > BACKDATE OR MIGDATE > '*-5' WHERE MIGDATE = BACK DATE AND VOLSER = '123456' AND MIGDSN IN ('USERID.DATA.SET', 'ANOTHER.USER.DATA.SET') WHERE MIGDATE = BACKDATE AND NOT (VOLSER = '123456' OR EXTENTS = 1) ```