IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To get the creation date and size of the unused datasets


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Wed Mar 19, 2008 11:07 pm
Reply with quote

Hi,
Our Lpar is having a lot of unused datasets which needs to be cleaned up based on the creation date and size.
I tried using listcat with VOLUME option in the batch job.I have a few problems.

1.I am not able to route the output to a dataset.I tried using outfile in the sysin along with Listcat,but it threw an error.
2.I am able to get the creation date but not the tracks/cyl used using the volume option.What other option can I use?
3.When the dataset is in MIGRAT2 will it occupy DASD space?Can we ignore them while selecting the datasets for deleting?How to consider only the active datasets.

Also I do not have priveledge to run the DCOLLECT command to collect the statistics.

Pls help me.

Thanks
Aneeta
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Mar 20, 2008 12:35 am
Reply with quote

Here is a suggestion. Take all the datasets you want to checkout and put them is an 80 byte FB datasets called "HLQ.YOUR.INPUT.DATASET" (You pick the name)

Take the following REXX code and put it in a REXX library called "HLQ.YOUR.REXX.LIB" (You pick the REXX library name) under the member name REXLIST1.

Code:

/********************** REXX *************************/       
/* THIS REXX READ A 80 BYTE DATASET AND DOES        */       
/* LISTDSI AGAINST EACH FILE. OUTPUT IS WRITTEN     */       
/* OUT OF THE JOB.                                  */       
/*                                                  */       
PARSE ARG DATASET                                             
DATASET = STRIP(DATASET,'B')                                 
CTRI1 = 0                                                     
CTRO1 = 0                                                     
ALLOC:                                                       
"ALLOC FI(INPUTFLE) DA("||DATASET||") SHR REUSE"             
IF RC > 0 THEN DO                                             
    SAY "ALLOCATE ERROR RC= " RC                             
    EXIT RC                                                   
END                                                           
READUMIN:                                                     
/* READ IN THE INPUT FILES AS STEM VARIABLES        */       
"EXECIO * DISKR INPUTFLE (STEM XXX. FINIS)"                   
ADDRESS TSO "FREE F(INPUTFLE)"                               
/* READ IN THE BASE INPUT FILE                      */       
GETREC:                                                       
   IF CTRI1 = XXX.0 THEN SIGNAL EXIT1                         
   CTRI1 = CTRI1 + 1                                         
   DSNCHK = SUBSTR(XXX.CTRI1,1,44)                           
   DSNCHK = STRIP(DSNCHK,'B')                                 
   ADDRESS TSO                                               
   X = LISTDSI("'"DSNCHK"'")                                 
   INTERPRET "X =" X                                         
   IF SYSMSGLVL2 ¬= ' ' THEN                                 
     DO                                                       
       ZEDLMSG = SYSMSGLVL2                                   
       SAY DSNCHK||"  "||ZEDLMSG                             
       SYSMSGLVL2 = ' '                                       
       SIGNAL GETREC                                         
    END                                                       
    say 'DATA SET NAME:         ' sysdsname                   
    say;                                                     
    say '   Volume serial:         ' sysvolume             
    say '   Device type:           ' sysunit',',           
        '(trks/cyl 'systrkscyl', blks/trk 'sysblkstrk')'   
    say '   Organization:          ' sysdsorg             
    say '   Record format:         ' sysrecfm             
    say '   Record length:         ' syslrecl             
    say '   Block size:            ' sysblksize           
    say '   Allocation units:      ' sysunits             
    say '   Space allocated:       ' sysalloc             
    say '   Space used:            ' sysused               
    say '   Primary allocation:    ' sysprimary           
    say '   Secondary allocation:  ' sysseconds           
    say '   Extents used:          ' sysextents           
    say '   Creation date:         ' syscreate             
    say '   Expiration date:       ' sysexdate             
   SIGNAL GETREC                                           
EXIT1:                                                     
EXIT                                                       


Now add a job card and run these JCLs with the libraries and datasets coded that you selected:

Code:

//REXX1   EXEC PGM=IKJEFT01,DYNAMNBR=10,TIME=1           
//SYSTSPRT DD  SYSOUT=*                                   
//SYSEXEC  DD  DSN=HLQ.YOUR.REXX.LIB,DISP=SHR           
//SYSPROC  DD  DSN=HLQ.YOUR.REXX.LIB,DISP=SHR           
//MEMLIST  DD  SYSOUT=*                                   
//SYSPRINT DD  SYSOUT=*                                   
//SORTMSG  DD  SYSOUT=*                                   
//SYSOUT   DD  SYSOUT=*                                   
//OUTPUT   DD  SYSOUT=*                                   
//LISTOUT  DD  SYSOUT=*                                   
//SYSTSIN  DD  *                                         
PROFILE NOPREFIX                                         
REXLIST1 HLQ.YOUR.INPUT.DATASET
/*
                             


The REXX program will reference each dataset coded in HLQ.YOUR.INPUT.DATASET and will provide information about it. If the dataset is migrated, it will tell you. If the dataset is not migrated, you will received information about your dataset. The output is produced in the SYSTSPRT DD statement. If you want this in a dataset, code a dataset for the SYSTSPRT DD statement:

Code:

//SYSTSPRT DD DSN=HLQ.OUTPUT,UNIT=SYSDA,DISP=(NEW,CATLG),
//  SPACE=(TRK,(100,25),RLSE)


IF you don't want all the individual information about each dataset, only certain parameters (like space, creation, etc.), you may delete the "SAY" statements in the REXX program for the items you DON'T want.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 20, 2008 12:43 pm
Reply with quote

Of of course you could use Dfdss to select the datasets for you, and even let Dfdss to archive / delete the datasets in one single job.

The selection criteria is very flexible.

Those shown as MIGRAT2 are migrated to HSM ML2 - usually tape.
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Fri Mar 21, 2008 12:07 am
Reply with quote

Hi cpuhawg,
Thank you so much for the code.As I am not so familiar with REXX i did not understand completely.

Expat,
Can u explain more on dfdss..Can u guide me to code it.

Thanks
Aneeta
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 21, 2008 2:20 am
Reply with quote

Hi,

A little information on DFDSS:

DFDSS stands for "Data Facility Data Set Services" An IBM licensed program used to copy, move, dump, and restore data sets and volumes.

Well, this would
Quote:
Can u guide me to code it
require a broad expalntion, a good start would be read this from Manuals & if stuck up some where get back to us, some one here would be having better suggestions..DFDSS/ADRDSSU informatoin is available from the "Manuals" on this site. Click on Manuals (at the top of the page), then click on "IBM JCL Utilities Guide for DFSMS".
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Apr 19, 2008 4:04 am
Reply with quote

Hi,

i don't speak REXX much, however, I tried the above suggestion by cpuhawg but got the below in SYSOUT, how to deal with it. Please suggest.
Code:
READY                                                                           
PROFILE NOPREFIX                                                               
READY                                                                           
HLQ HLQ.LIST.ALL                                                       
READY  IKJ58405I DATA SET NOT CATALOGUED. THE LOCATE MACRO RETURN CODE IS 0008 
IKJ56709I INVALID DATA SET NAME, '%IGGCSIRX'                                   
%IGGCSIRX  IKJ58401I ERROR PARSING THE STATEMENT. PARSE SERVICE RETURN CODE IS 00004
IKJ56709I INVALID DATA SET NAME, 'ENTER
IKJ56712I INVALID KEYWORD, KEY'       
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Apr 26, 2008 4:05 am
Reply with quote

ping..just to ask again..please delete this post, once above is answered
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
Search our Forums:

Back to Top