﻿--  category:  IBM i Services for BRMS
--  description:  Application - BRMS Control Group Omits Views
--  minvrm: V7R3M0
--  last updated: 3/14/2023

--
-- To show ALL control groups items for system libraries - non-IFS backups
--
SELECT *
    FROM QUSRBRM.BRMS_CONTROL_GROUP_OMITS
    ORDER BY CONTROL_GROUP,
             SEQUENCE_NUMBER;

--
-- To show ALL control groups omits
--
SELECT *
    FROM QUSRBRM.BRMS_CONTROL_GROUP_OMITS
    WHERE LIST_OMIT = 'OMIT'
          OR GLOBAL_OMIT_LIBRARY IS NOT NULL
    ORDER BY CONTROL_GROUP,
             SEQUENCE_NUMBER;

--
-- To show all the control groups and which entries are using the WRKPCYBRM *BKU option 2 omits
--
SELECT CONTROL_GROUP,
       SEQUENCE_NUMBER,
       BACKUP_ITEM,
       GLOBAL_OMIT_LIBRARY
    FROM QUSRBRM.BRMS_CONTROL_GROUP_OMITS
    WHERE GLOBAL_OMIT_LIBRARY IS NOT NULL
          AND LIST_OMIT IS NULL
    ORDER BY CONTROL_GROUP,
             SEQUENCE_NUMBER;

--
-- To show the WRKPCYBRM *BKU option 2 items - no duplicates or control group names
--
SELECT DISTINCT BACKUP_ITEM,
                GLOBAL_OMIT_LIBRARY
    FROM QUSRBRM.BRMS_CONTROL_GROUP_OMITS
    WHERE GLOBAL_OMIT_LIBRARY IS NOT NULL
          AND LIST_OMIT IS NULL;

--
-- To show object omits
--
SELECT CONTROL_GROUP,
       SEQUENCE_NUMBER,
       BACKUP_ITEM,
       LIBRARY,
       OBJECT,
       OBJECT_TYPE,
       OBJECT_ATTRIBUTE,
       OBJECT_MEMBER
    FROM QUSRBRM.BRMS_CONTROL_GROUP_OMITS
    WHERE LIST_OMIT IS NULL
          AND LIST_OMIT = 'OMIT'
          AND LIBRARY IS NOT NULL
    ORDER BY CONTROL_GROUP,
             SEQUENCE_NUMBER;



