How to do Delete/Define with using IDCAMS using batch JCL (z/VSE)

user2155147 picture user2155147 · Aug 30, 2013 · Viewed 23.6k times · Source

I have a sample code of delete/define using IDCAMS in z/OS, but I dont think it will work on z/VSE. Can someone help me convert this? The file created should be VSAM-kSDS.

//VDFNDEL  JOB 1,SAMPLE,MSGCLASS=X
//STEP1    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*    
//SYSIN    DD *    

 DELETE SAMPLE.DATA.VSAM CLUSTER

/*   
//STEP2    EXEC PGM=IDCAMS
//SYSPRINT DD *
//DATAIN   DD DISP=OLD,DSN=SAMPLE.SORTOUT 
//SYSIN    DD *

 DEFINE CLUSTER (NAME (SAMPLE.DATA.VSAM) -
           VOLUMES(WORK02) CYLINDERS(1 1) -
           RECORDSIZE (72 100) KEYS(9 8) INDEXED)

 REPRO INFILE(DATAIN) OUTDATASET(SAMPLE.DATA.VSAM) ELIMIT(200)

/*

Answer

James Anderson picture James Anderson · Aug 30, 2013

Your IDCAMs statements should be pretty much the same but the JCL is completely different.

    * $$ JOB JNM=OGDEN12,CLASS=0,DISP=D
// JOB OGDEN12
// DLBL OGDEN,'OGDEN.DATA.VSAM',,VSAM,CAT=VSESPUC
// EXEC IDCAMS,SIZE=AUTO
DELETE (OGDEN.DATA.VSAM) CLUSTER PURGE -
CATALOG(VSESP.USER.CATALOG)
/*
// EXEC IDCAMS,SIZE=AUTO
DEFINE CLUSTER(NAME(OGDEN.DATA.VSAM) -
FILE(OGDEN) -
RECORDS (2000 1000) -
TO (99366) -
INDEXED -
KEYS(9 8) -
RECORDSIZE(72 100) -
CONTROLINTERVALSIZE(4096) -
SPANNED -
SHR(4) -
VOLUMES (DOSRES,SYSWK1)) -
DATA (NAME (OGDEN.DATA.VSAM.@D@)) -
INDEX (NAME (OGDEN.DATA.VSAM.@I@)) -
CATALOG(VSESP.USER.CATALOG)
/

Example taken from the extremely useful redbook