TPX batch - example - How to delete sessions from multiple profiles

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

Introduction: 

The Batch component of CA TPX allows you to report on and update information in the administration database.

 

Question: 

I am trying to clean up obsolete sessions/applids from multiple profiles. Do I need a separate statement for each? Is there a way to use a masking character?

For example:

DELETE TPX PROFILESESSION (* AAAAAA)  

-or-

DELETE TPX PROFILESESSION (-------  AAAAAA)

 

Environment:  

TPX 5.3 & 5.4

 

Answer: 

You cannot delete directly with wildcards.  See TEC510938 TPX Batch - example - How to delete with wildcards.
 
 
To delete sessions from multiple profiles directly, you need to provide the profile name and session id:
 
DELETE TPX PROFILESESSION (PROFILE1 AAAAAA
                           PROFILE2 AAAAAA
                           PROFILE3 AAAAAA) 
 
 
Another way to address this is to extract the profile session records based upon your requirements:
 
 
If AAAAAA is the session id, PENTUSER:
 
EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
        (PENTUSER(AAAAAA)) 
DELETE PROFILESESSION USING(EXTFILE)
 
 
If AAAAAA is the applid, PENTAPPL:
 
EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
        (PENTAPPL(AAAAAA)) 
DELETE PROFILESESSION USING(EXTFILE)

 

If you have more than one session/applid to delete across multiple profiles, here are a few more options:

 

To delete profile sessions directly, you need to provide the profile name and session id, without any wildcards:
 
DELETE TPX PROFILESESSION (PROFILE1 AAAAAA
                           PROFILE1 AAABBB
                           PROFILE2 AAAAAA
                           PROFILE2 AAABBB
                           PROFILE3 AAA999) 
 
 
You can extract with wildcards:
 
 
If AAA* is the session id, PENTUSER:
 
EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
        (PENTUSER(AAA-----)) 
DELETE PROFILESESSION USING(EXTFILE)
 
 
If AAA* is the applid, PENTAPPL:
 
EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
        (PENTAPPL(AAA-----)) 
DELETE PROFILESESSION USING(EXTFILE)

 

Additional Information:

 

TPX 5.4 Batch Administration - Delete Sessions From Users and Profiles

TPX 5.4 Batch Administration - Using Extract files - Delete Users, Profiles and Sessions

TEC510938 TPX Batch - example - How to delete with wildcards

We recommend producing a REPORT on the extracted file prior to executing the DELETE so that you can confirm what will be delete.  

In addition, we recommend repeating the EXTRACT and REPORT after the delete.