How to create a report of Disk Backup and Archive entries from a Datacom FILES DB to show backup and archival entries using SQL?
Release: Diskā¢ Backup and Restore
Use the following sample SQL statement as template and execute it via the DBSQLPR utility:
SELECT
DSNDSNAM as Data_Set_Name,
DSNVOLNO as VolSer,
DSNARVOL as ArcVol,
case
when bit_and(DSNFLAG1,X'80') = X'80'
then 'Archive' else 'Backup'
end as ArcBac
FROM CADISK.DSNINDEX_650
WHERE DSNDSNAM like 'ABC.%';
To select only Archives, modify the WHERE clause as follows:
WHERE DSNDSNAM like 'ABC.%'
and DSNFLAG1 >= X'80';
To select only Backups, you need to modify the WHERE clause as follows:
WHERE DSNDSNAM like 'ABC.%'
and DSNFLAG1 < X'80';