CategoryVSAM

VSAM record count using File-Aid

Whats the best way to count the number of records in a VSAM File?

  1. Choose FILE-AID Option 3.8.
  2. At the prompt of ….ENTER NEXT FUNCTION OR END , enter TALLY.
  3. You will get the record count.
  4. Type END to exit.

Read Only VSM Files

By using INHIBIT along with ALTER command, we can have a read-only VSAM dataset.

Example:

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER –
SECRET.KSDS.DATA –
INHIBIT
ALTER –
SECRET.KSDS.INDEX –
INHIBIT
/*

Notice that the ALTER command is used with DATA and INDEX and not with the cluster.

Dummy VSM Dataset in JCL

In general we use DUMMY datasets in JCL instead of a actual file for some requirements.

But how can we specify dummy VSAM dataset in a JCL?

The parameter AMP=’AMORG’ tells the OS to treat the file as VSAM file.

//NOVSAMIO DD DUMMY,AMP=’AMORG’