Page 1 of 1

How to see who edited the Mainframe file last ??

Posted: Thu Oct 03, 2013 9:40 pm
by ysharma
Hi Guys
I am having a GDG version and want to know who edited this GDG version last.
Anyone know how to check that ??

Re: How to see who edited the Mainframe file last ??

Posted: Thu Oct 03, 2013 10:52 pm
by Anuj Dhawan
Hi Ysharma,

I doubt if there is any easy way of doing it with native commands. SMF can have such info, SMF record 15 should be of help.

On the other hand, try this REXX, this can be of help for you, though it's for a PDS:

Code: Select all

/*Rexx routine to read a pds directory and show the ispf stats     */  
/*     non load module only.                                       */  
/* Author: Doug Nadel - 3/31/2001 */                                    
Parse Upper Arg dsname .                                                
If 0<>listdsi(dsname) Then                                              
  Do                                                                    
    Say 'Data set 'dsname' not allocated'                              
    Exit                                                                
  End                                                                  
If 'PO'<>substr(sysdsorg,1,2) Then                                      
  Do                                                                    
    Say 'Data set 'dsname' is not a pds'                                
    Exit                                                                
  End                                                                  
Address tso                                                            
'ALLOC F(AREAD) DS('dsname') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)' 
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'                              
'FREE F(AREAD)'                                                        
Do blocknum = 1 to dirs.0                                              
'FREE F(AREAD)'                                    
Do blocknum = 1 to dirs.0                          
  block=dirs.blocknum                              
  Parse Var dirs.blocknum bl 3 block                
  block=substr(block,1,c2d(bl)-2)                  
  Do While block<>''                                
    Parse Var block name 9 ttr 12 c 13 block        
    c=c2d(bitand(c,'1f'x))                          
    If name='FFFFFFFFFFFFFFFF'x Then                
      Leave blocknum                                
    stats=''                                        
    If c=15 & sysrecfm \= 'U' Then                  
      stats=decodestats(substr(block,1,30))        
    Say name stats                                  
    block=delstr(block,1,c*2)                      
  End                                              
End                                                
Exit                                                
decodestats:  Procedure  /* decode the directory */ 
direntry=Arg(1)                                    
  Parse Var direntry,                                                
    vv 2 mm 3 flags 4 ss 5 crecc 6 crdate 9 modcc 10 moddate 13 hh,  
    14 tm 15 lines 17 init 19 mod 21 userid 28 .                      
  Parse Value c2x(crdate)  with cyy 3 cjjj 6 .                        
  Parse Value c2x(moddate) with myy 3 mjjj 6 .                        
  out=leftd(vv)'.'leftd(mm)                       /* Vv.Mm         */ 
  out=out 19+c2x(crecc)cyy'.'cjjj                 /* Create date   */ 
  out=out 19+c2x(modcc)myy'.'mjjj                 /* Mod date      */ 
  out=out leftx(hh)':'leftx(tm)':'leftx(ss)       /* mod time      */ 
  out=out right(c2d(lines),5)                     /* Lines         */ 
  out=out right(c2d(init),5)                      /* Initial lines */ 
  out=out right(c2d(mod),5)                       /* Mod lines     */ 
  out=out userid                                  /* User id       */ 
  If bitand(flags,'80'x) = '80'x Then                                
    out=out '(SCLM)'                              /* Saved by SCLM */ 
  Return out                                                          
leftd: return right(c2d(arg(1)),2,'0')                                
leftx: return right(c2x(arg(1)),2,'0')

Re: How to see who edited the Mainframe file last ??

Posted: Fri Oct 04, 2013 10:03 pm
by ysharma
Hi Anuj,
Thanks for the rexx code...
I Will try for that.... But mine is PS.
Is there any way we can request IBM team to give such permission to look for the last update details

Re: How to see who edited the Mainframe file last ??

Posted: Fri Oct 04, 2013 10:54 pm
by Kapil Sharma
ysharma wrote:Is there any way we can request IBM team to give such permission to look for the last update details
Are you really serious while making this statement? :)

Re: How to see who edited the Mainframe file last ??

Posted: Fri Oct 04, 2013 11:10 pm
by Robert Sample
ysharma: what you want to know is NOT stored with the data set. It is not in the catalog, it is not on the disk drive, and asking IBM will not magically make it available to you.

The ONLY source for what you want to know the SMF (System Management Facility) records. Note that your site has the option to select which records to keep, so it is possible (although not likely) that your site does not even keep the data you want -- in which the answer to your question would be that for your site it is NOT possible, at all, to determine who updated a data set.

Assuming that your site keeps the SMF records that record who modified the data set, you would need to work with your site support group to retrieve and interpret those records. SMF data is complex and highly optimized for output, and hence you would need assistance is interpreting the data. Also, most sites usually record one file per day so you would have to have some idea when the update occurred. SMF data is NOT something that someone new to mainframes could understand without several MONTHS of intense study.

Re: How to see who edited the Mainframe file last ??

Posted: Sat Oct 05, 2013 5:29 pm
by Anuj Dhawan
ysharma wrote:Thanks for the rexx code...
I Will try for that.... But mine is PS.
Is there any way we can request IBM team to give such permission to look for the last update details
You're welcome Ysharma.

One can reach out to IBM but they don't work on individual requests and need a proper follow up and justification.

If you are looking this information for some Test-file(s) in Test region which was edited by someone mistakenly, chances of getting involved IBM in this are very distant. As Robert has also indicated SMF records can be of your help.

Possibly, if you explain the scenario at your end in more details - someone might just help with you some alternative...