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

--
-- Query to identify volumes that are part of a serial set
--
SELECT VOLUME_SERIAL
    FROM qusrbrm.media_info
    WHERE VOLUME_STATUS = 'ACTIVE'
          AND SERIAL_SET = 'YES';


--
-- Query to identify volumes that are part of a parallel set
--
SELECT VOLUME_SERIAL
    FROM qusrbrm.media_info
    WHERE VOLUME_STATUS = 'ACTIVE'
          AND PARALLEL_SET = 'YES';

--
-- Create a view of the volumes set information
-- Example: Retrieve volume serial, sequence, status, media class, location, expiration and expiration dates
-- for a volume serial 000950
--
SELECT VOLUME_SERIAL,
       SEQUENCE,
       VOLUME_STATUS,
       MEDIA_CLASS,
       LOCATION,
       EXPIRATION_DATE,
       EXPIRATION
    FROM TABLE (
            QUSRBRM.MEDIA_SET_INFO('000950')
        )
    ORDER BY SEQUENCE;

