Verifying file status (VERIFY)


VERIFY command is used to verify the status of the dataset. The VSAM dataset may not be closed when the job terminates abnormally, and catalog entry is flagged to show that the dataset may be corrupt.

Before opening the dataset again, the VERIFY command is used to identify the end of the dataset and reset the catalog entry.

Syntax -

//JOBNAME  JOB job-card-parameters
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  VERIFY {FILE(ddname)| 
     DATASET(dataset-name)}
  	 [RECOVER]
/*

Mandatory Parameters


  • FILE (ddname) - Specifies the DD name of the dataset to be verified. This is used when the dataset is allocated using a DD statement.
  • DATASET (dataset-name) - Specifies the name of the VSAM dataset to verify. This parameter can include wildcards to verify multiple datasets at once. Short Description: DS
  • FILE (ddname) - Specifies the DD name of the dataset to be verified. This is used when the dataset is allocated using a DD statement.
  • CATALOG (catname) - Specifies the name of the catalog where the path will be defined. Short Description: CAT

Example -


Scenario - Copy data from KSDS to PS file from E0003 to E0005.

Input ESDS File - MATEPK.EMPL.KSDS

JCL -

----+----1----+----2----+----3----+----4----+----5----+
...
//STEP010  EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT    DD DSN=MATEPK.EMPL.KSDS,DISP=SHR
//SYSIN    DD  *
  VERIFY   -
       FILE(INPUT)
/*
...

Output -

Once the above JCL is submitted, check the MAXCC of the job for any errors. If the MAXCC is 00 or 04, then the file is good to use.

VERIFY Sysprint