I(TEST123) want to access a particular dataset of T12345 with READ access at beginning of my program execution and after finishing everything i want the READ access to be revoked on the dataset which i acquired READ permissions in begining.
for this i wrote two JCL for getting READ access and REVOKING access
//DATSETPR EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=512K
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ADDSD 'T12345.OP.PS' UACC(NONE)
PE 'T12345.OP.PS' ID(TEST123) ACCESS(NONE)
//
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
ADDSD 'T12345.OP.PS' UACC(NONE)
PE 'T12345.OP.PS' ID(TEST123) ACCESS(NONE)
//
for revoking the access i'm writing
//DATSETPR EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=512K
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DELDSD 'T12345.OP.PS'
//
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DELDSD 'T12345.OP.PS'
//
My whole idea is to get READ access on T12345.OP.PS and revoking that READ access at the end. Both has to be successful with MAXCC = 0.
Is the way what i wrote is correct ??