Page 1 of 2

REXX:How to list datasets created by an USERID into a file

PostPosted: Mon Jul 21, 2008 11:02 am
by kamal
How to list all the datasets created by an USERID into a flat file(80 FB) using REXX.

Thanks!

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Mon Jul 21, 2008 2:54 pm
by kamal
Hmm..was trying from morning ...finally found this code on one of the forums
/*REXX*/                                                         
DSNAME =""USERID""."*"                                         
"ISPEXEC LMDINIT LISTID(IDV) LEVEL(&DSNAME)"                     
cnt=1                                                           
DO FOREVER                                                       
   "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSNAME) "
   IF RC = 0 THEN                                               
    DO                                                           
/* SAY "'"DSNAME"'"*/                                           
     DSNAME1 ="'"DSNAME"'"                                       
     y = LISTDSI(DSNAME1 directory)                             
     SAY DSNAME SYSCREATE SYSREFDATE                             
     DATA.CNT = DSNAME SYSCREATE SYSREFDATE                     
     CNT = CNT + 1                                               
    END                                                         
   ELSE LEAVE                                                   
END                                                             
"ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"   
"ALLOC FI(OUT) NEW RECFM(F B A) LRECL(80)",                   
"BLKSIZE(0) SPACE(5,5)  TR",                                   
"DA(DELETE.ME2)"                                               
'EXECIO * DISKW  OUT (STEM DATA. FINIS'   /* copy using stem*/
"FREE F(OUT)"                                                 

 


It's working;I added creation and reference date(s) too.

Now am facing another problem as:
When I say
y = LISTDSI(DSNAME1 directory)   

It recalls the migrated datasets and DASD is unnecessary occupied...
Is there any way by which we can get the creation/reference date without recalling the datasets?
Guess no..but then can we remigrate the recalled datsets?
Please share the code or suggest any other way to accomplish it.

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Mon Jul 21, 2008 10:06 pm
by dick scherrer
Hello,

So far, i've supported several hundred mainframes. None has ever had the requirement to determine the creating userid. This is somehthing often done in a Win-based environment (and sometimes unix) but not the mainframe. On the mainframe nearly everything is managed/controlled by high-level quelifier (hlq) and there is not much value in the creating userid (most datasets are actually not created by some user).

To recall all of the migrated datasets to merely get the creating userid is a major waste of system resources. To re-migrate them is yet another waste. You might simply "skip" any that are migrated. . .

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Wed Jul 23, 2008 12:49 pm
by kamal
On the mainframe nearly everything is managed/controlled by high-level quelifier (hlq)

Must be true..and here in our shop HLQ is always a creator's USERID.
We can create datasets with name starting with USERID as HLQ only.
Sorry for the confusion

Actually I wanted to list all the datasets with particular HLQ ,which are not being used in near time.
For that I took date of last refernce into consideration and if the lr date is less than 2 months or more to current date then will list those datsets.These datsets could be on DASD,TAPE or migrated.
If anybody could suggest way to accomplish it; would be a great help!!

Hope I have put requirement properly.

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Thu Jul 24, 2008 2:32 am
by Bill Dennis
Do you really need the DIRECTORY option just to get your dates? That may be causing the recall.

You can also say NORECALL on LISTDSI and take an error for migrated files.

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Thu Jul 24, 2008 2:34 am
by dick scherrer
Hello,

We can create datasets with name starting with USERID as HLQ only.
I suspect this is the rule for datasets created by developers. I also suspect that the production libraries, vsam files, database datasets do not use some personal userid as the hlq. . . But that will not help get what you need ;)

To find out everyting that has happened to datasets (regardless of media), you could find all dataset references in the smf data.

If you talk with your storage management people, they may already have something that will meet your requirement that reports against the smf data.

Given that much of the data you want to monitor is migrated, there may be some info created by sms that would help. Again the storage management people would be knowledgable if such info is already available on your system.

Re: REXX:How to list datasets created by an USERID into a file

PostPosted: Mon Jul 28, 2008 3:06 pm
by kamal
Dick, I am thinking on points you told...actually it's not possible for us to reach storage people easily.So as of now am taking Bill Dennis' suggestions ...'norecall' option works!
Thanks a lot both of you!!

Re: REXX:How to list datasets created by an USERID into a fi

PostPosted: Wed Sep 05, 2012 7:01 pm
by balamurali cl
Hi Kamal,

I als doing the same work now.

I have written a REXX program where I liat all the files created by a user and Now I want to get the last refernced date of all the datasets and if the last refernced date is 365 days ago, I am trying to list It...Here all the datasets are geeting recalled and hense refernced date is shown as todays.

I used the NORECALL option and for that the dataset is not recalled but the RC is 16.

But with that I cant tell that the Dataset is 365 days ago refernced.

Please let me know how you accomplished the task ..please help me...it will help a lot

Re: REXX:How to list datasets created by an USERID into a fi

PostPosted: Wed Sep 05, 2012 7:32 pm
by dick scherrer
Hello,

You can recall all of them or you can skip over the migrated datasets. . .

If they are migrated, and the "owner" has not deleted them, suggest you do not delete them either. . . Many valuable files are not "touched" for a year or more and the cost of having them archived is nothing compared to the grief if they are deleted and needed.

Re: REXX:How to list datasets created by an USERID into a fi

PostPosted: Wed Sep 05, 2012 7:39 pm
by Akatsukami
dick scherrer wrote:Many valuable files are not "touched" for a year or more

The same is true of many threads :mrgreen: