Create a report of Disk Backup and Archive entries using SQL on a Datacom FILES DB
search cancel

Create a report of Disk Backup and Archive entries using SQL on a Datacom FILES DB

book

Article ID: 46616

calendar_today

Updated On:

Products

Disk Backup and Restore - MVS DISK BACKUP AND RESTORE- ADD-ON OPTIO DISK BACKUP AND RESTORE

Issue/Introduction

How to create a report of Disk Backup and Archive entries from a Datacom FILES DB to show backup and archival entries using SQL?

Environment

Release: Diskā„¢ Backup and Restore

Resolution

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';