MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Identify VSAM Cluster from a dataset.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Fri Mar 16, 2018 11:35 am    Post subject: Identify VSAM Cluster from a dataset. Reply with quote

Hi,

I am trying to write a rexx to delete the data sets which have been used/referenced three months before.

Code:

/* REXX */                                                           
  I = 1                                                               
  VOLUME ="XYZ2*"                                                     
  ADDRESS ISPEXEC                                                     
  IF ISPEXEC("LMDINIT LISTID(LID) VOLUME("VOLUME")") >= 8 THEN EXIT 8
  DO WHILE ISPEXEC("LMDLIST LISTID(&LID) DATASET(DSNAME)             
        STATS(YES) OPTION(LIST)") = 0                                 
    OU.I = LEFT(DSNAME,40) ZDLVOL ZDLSIZE ZDLRDATE ZDLCDATE ZDLDSORG 
    I = I + 1                                                         
  END                                                                 
  CALL ISPEXEC "LMDFREE LISTID(&LID)"                                 
  ADDRESS TSO                                                         
  "ALLOC F(DDOU) DS('USERID.DATA') SHR REUSE"               
  "EXECIO * DISKW DDOU (FINIS STEM OU."                               
  "FREE F(DDOU)"                                                     
  EXIT 0                                                             
ISPEXEC:                                                             
  ARG CMD
  "CONTROL ERRORS RETURN"     
   CMD                       
   RES = RC                   
   IF RES >= 8 THEN DO       
     "SETMSG MSG(ISRZ002)"   
   END                       
  "CONTROL ERRORS CANCEL"     
  RETURN RES                                                                               


The above code will generate the list of datasets for given volume and last referenced date.

And then I am using following sort code to remove duplicates and filter the datasets referenced/used greater than 90 days

Code:

//SYSIN   DD *                                                       
  INREC IFTHEN=(WHEN=(56,10,CH,EQ,C'***None***'),OVERLAY=(56:67,10)) 
  SORT FIELDS=(1,40,CH,A)                                             
  SUM FIELDS=NONE                                                     
  OUTFIL INCLUDE=(56,10,CH,LT,DATE1(/)-90,AND,78,2,CH,NE,C'PO')       


Fields
1,40 Dataset Name
42,6 Volume
49,6 CYL
56,10 Last referenced date
67,10 Creation date
78,4 DSORG

The list includes VSAM data and Index but not cluster, because cluster will not have Volume information.

Is there a way to identify the VSAM cluster for a given dataset ?

Thanks
Magesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Fri Mar 16, 2018 2:38 pm    Post subject: Reply with quote

Magesh_J wrote:
Hi,

I am trying to write a rexx to delete the data sets which have been used/referenced three months before.


Magesh_J,

I think you are trying to re-inventing the wheel. ADRDSSU does a fantastic job of deleting the datasets based on the Last referenced date. Here is an example of deleting the datasets using ADRDSSU

http://www.mvsforums.com/helpboards/viewtopic.php?t=2758&highlight=refdt

I suggest you run the jcl with TYPRUN=NORUN so that you can actually see the list of datasets that are going to be delete ( just to make sure you are deleting the right datasets)

ie.
Code:

//STEP0100 EXEC PGM=ADRDSSU,PARM='TYPRUN=NORUN'


TYPRUN=NORUN - This parameter requests that only data set filtering is to be done if a RESTORE, COMPRESS, COPY, DUMP, or RELEASE operation is requested. If a DEFRAG is requested, then a DEFRAG report is printed but no data sets are actually moved. A full report is produced for a CONVERTV operation but no volumes or data sets are actually converted. This parameter is useful for simulating DFDSS processing to determine what its actual affect will be.


If you still need a programmatic solution you can refer to the following thread

https://www.mvsforums.com/helpboards/viewtopic.php?t=12752
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Mon Mar 19, 2018 1:41 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks, But I couldn't find a way to delete dataset by volumes.

Regards,
Magesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Mon Mar 19, 2018 4:38 pm    Post subject: Reply with quote

Magesh_J wrote:
Hi Kolusu,

Thanks, But I couldn't find a way to delete dataset by volumes.

Regards,
Magesh


Magesh_J,

You can delete the datasets on a particular volume. This will show all the VSAM clusters on the volume XXXXXX. If you want nonvsam datasets then you can simply change the DSORG,EQ,VSAM to DSORG,NE,VSAM

This will give you a list of all the VSAM clusters that haven't been referred to in the last 30 days and you can find the list after the message ADR475I in the SYSPRINT

Once you verified you got the right list of datasets simply remove the TYPRUN parm and re-submit the job
Code:

//STEP0100 EXEC PGM=ADRDSSU,PARM='TYPRUN=NORUN'                     
//SYSPRINT DD SYSOUT=*                                             
//PSEUDO   DD DUMMY                                                 
//SYSIN    DD *                                                     
   DUMP                              /* DUMP COMMAND         */ -   
        LOGINDYNAM(XXXXXX)           /* VOLUME NAME          */ -   
        OUTDD(PSEUDO)                /* OUTPUT DDNAME        */ -   
      DATASET(BY((REFDT,LE,*,-30)    /* LAST REFDT < 30 DAYS */ -   
                 (DSORG,EQ,VSAM)))   /* ALL VSAM CLUSTER     */ -   
      DELETE PURGE                   /* DELETE THE DATASETS  */     
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Tue Mar 20, 2018 11:29 am    Post subject: Reply with quote

Hi Kolusu,

There are 60 volumes in total, but from storage team, I come to know XYV.YZY.** and XYN.YZV.** belongs to XYZ2* volumes.

I used following code from your solution, and it worked great.

For vsam
Code:

DUMP           -       
 DS(INCL(XYVV.YZY.**)  -
 BY((REFDT,LE,*,-90)  -
    (DSORG,EQ,VSAM))) -
 OUTDD(PSEUDO)       -
 DELETE             


for other datasets
Code:

DUMP                 
 DS(INCL(XYN.YZV.**) -
 BY((REFDT,LE,*,-90) -
    (DSORG,NE,VSAM))) -
 OUTDD(PSEUDO)       -
 DELETE   


Thanks

Regards,
Magesh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Tue Mar 20, 2018 11:45 am    Post subject: Reply with quote

Magesh_J wrote:
Hi Kolusu,

There are 60 volumes in total, but from storage team, I come to know XYV.YZY.** and XYN.YZV.** belongs to XYZ2* volumes.
I used following code from your solution, and it worked great.


Magesh_J,

Glad you got it working. But shouldn't this be the task of the storage admin?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Tue Mar 20, 2018 4:19 pm    Post subject: Reply with quote

These are project specific test data sets, so we have to perform these cleanups.

Thanks
Magesh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group