TPX Batch - example 2 - How to identify users that have not logged on for awhile?

Document ID : KB000022804
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This batch example shows you how to extract and optionally delete users that have not logged on since a specific date by masking on the last TPX logon date.

Solution:

You can extract users by masking on variable VUSRDACC which is the last TPX logon date.

The format of VUSRDACC is mm/dd/yy. For example: 03/31/10

This example will list users whose last logon was in 2008 or 2009:

 //BATCHADM EXEC TPX,VNODE='*BATCH*'  
 //EXTFIL1  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD) 
 //RPTFIL1  DD SYSOUT=* 
 //EXTFIL2  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD) 
 //RPTFIL2  DD SYSOUT=* 
 //SYSIN DD * 
 C 
 C  List all users who last logged on during 2008 & 2009 
 C 
 C  VUSRDACC The date on which the user last signed on to CA TPX. 
 C 
 EXTRACT GIVING(EXTFIL1) USER AND NO SESSIONS ( 
                                      VUSRDACC(------08 ------09)) 
 SET RTITLE1 
 ' USERID    LAST TPX LOGON in 2008 & 2009' 
 SET RTITLE2 
 ' ========  =============================' 
 REPORT GIVING(RPTFIL1) USING(EXTFIL1) 
 (( ' &UIDXNAME' ' &VUSRDACC        ')) 

Once you are happy with this output, then you can add the DELETE USING.
You should then run the above report again after the delete so that you have the before and after.

  EXTRACT GIVING(EXTFIL1) USER AND NO SESSIONS ( 
                                      VUSRDACC(------08 ------09)) 
 SET RTITLE1 
 ' USERID    LAST TPX LOGON in 2008 & 2009 - BEFORE DELETE' 
 SET RTITLE2 
 ' ========  =============================================' 
 REPORT GIVING(RPTFIL1) USING(EXTFIL1) 
 (( ' &UIDXNAME' ' &VUSRDACC        ')) 
 DELETE USER USING(EXTFIL1) 
 EXTRACT GIVING(EXTFIL2) USER AND NO SESSIONS ( 
                                      VUSRDACC(------08 ------09)) 
 SET RTITLE1 
 ' USERID    LAST TPX LOGON in 2008 & 2009 - AFTER DELETE' 
 SET RTITLE2 
 ' ========  ============================================' 
 REPORT GIVING(RPTFIL2) USING(EXTFIL2) 
 (( ' &UIDXNAME' ' &VUSRDACC        ')) 

NOTE: A blank date indicates that the user has never logged on.