﻿--  category:  IBM i Services for BRMS
--  description:  Application - BRMS Copy Control Group Procedure
--  minvrm: V7R3M0
--  Requires BRMS PTFs - 7.5 SI82234, 7.4 SI82233, 7.3 SI82232
--  last updated: 3/15/2023

--
-- CALL QUSRBRM.COPY_CONTROL_GROUP(
--      SOURCE_CONTROL_GROUP=> source-control-group,          Required
--      NEW_CONTROL_GROUP=> new-control-group,                Required
--      CONTROL_GROUP_TYPE => type,                           Optional
--      COPY_LIST=> copy-list,                                Optional
--      OVERWRITE=> overwrite,                                Optional
--      SYSTEM_NAME=> system-name);                           Optional
--
-- Example: Copy an existing backup control group named MYCGTEST on the local system
--          to a new control group named MYCGCOPY on the local system
--
CALL QUSRBRM.COPY_CONTROL_GROUP(
    SOURCE_CONTROL_GROUP => 'MYCGTEST',
    NEW_CONTROL_GROUP => 'MYCGCOPY'
);

--
-- Example: Copy an existing backup control group named MYCGTEST to another system named APPN.SYSTEM1
--          with the same control group name. On the copy, create and copy any existing lists in the
--          control group and overwrite the control group if it already exists on APPN.SYSTEM1.
--
CALL QUSRBRM.COPY_CONTROL_GROUP(
    SOURCE_CONTROL_GROUP => 'MYCGTEST',
    NEW_CONTROL_GROUP => 'MYCGTEST',
    COPY_LIST => 'ALL',
    OVERWRITE => 'YES',
    SYSTEM_NAME => 'APPN.SYSTEM1'
);

--
-- Example: Copy an existing backup control group named MYCGTEST to all the systems in the existing
--          BRMS network to the same control group name. On the copy, create and copy any existing lists in the
--          control group and overwrite the control group if it already exists on APPN.SYSTEM1.
--
CALL QUSRBRM.COPY_CONTROL_GROUP(
    SOURCE_CONTROL_GROUP => 'MYCGTEST',
    NEW_CONTROL_GROUP => 'MYCGTEST',
    COPY_LIST => 'ALL',
    OVERWRITE => 'YES',
    SYSTEM_NAME => 'NETGRP'
);
