How to check VSAM file is closed or not?

Verify VSAM Dataset

If a job terminates abnormally and a VSAM dataset is not closed, the catalog entry for the dataset is flagged to indicate that the dataset may be corrupt.  Before the dataset can be opened again, the VERIFY command must be used to correctly identify the end of the dataset and reset the catalog entry.

Model syntax for the VERIFY command:

VERIFY {FILE(ddname[/password])  | 
    DATASET(entryname[/password])}

The dataset to be verified may be specified by either FILE, which designates a DD name for which a DD statement must be provided to identify the dataset, or DATASET, which designates the name which is used to identify the dataset in the catalog.  There is no CATALOG option for the VERIFY command, so if there is no alias defined for the catalog in which the dataset can be located, it will be necessary to use either a JOBCAT or STEPCAT DD statement for the proper catalog.

Example

The following jobstream verifies a VSAM dataset.

//VERIFY JOB ‘JAY MOSELEY’,CLASS=A,MSGLEVEL=(1,1),MSGCLASS=A

//IDCAMS EXEC PGM=IDCAMS,REGION=4096K

//SYSPRINT DD SYSOUT=A

//SYSIN DD *

VERIFY DATASET(MVS801.STUDENT.FILE)

/* //          

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.