TPX batch -example- How to list USERs and the associated PROFILEs.

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

Description:

This document provides several examples on how to code an extract job to list profiles for users.

Solution:

This job will list all users and their profiles:

//BATCHADM EXEC TPX,VNODE='*BATCH*'   
//EXTFILE DD UNIT=SYSDA,SPACE=(CYL,(1,1))   
//RPTFILE DD SYSOUT=*   
//*   
//SYSIN DD *   
C   
C List profiles for each user -   
C   
EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS   
(UIDXNAME(--------) VUSRPROF(--------))   
C   
SET RTITLE1   
' USERID '   
SET RTITLE2   
' 1ST PROF 2ND PROF 3RD PROF 4TH PROF 5TH PROF 6TH PROF 7TH PROF'   
SET RTITLE3   
' ======== ======== ======== ======== ======== ======== ========'   
REPORT GIVING(RPTFILE) USING(EXTFILE)   
((' ')                                                                   
(' &UIDXNAME ' )                                                       
(' &VUSR$PRF                                                       '))

NOTE: If you have users with more than 7 profiles, you will need to specify a SYSIN dataset with LRECL long enough to accommodate the necessary line length. In addition, see the CA TPX Batch Administration Guide chapter Using Extract Files for Reporting: Formatting Your Reports - Formatting a Field Longer than 78 Characters.

If you need to filter your report, you can specify one or more values for each variable or use masking. For example:

All users with profile ABCDPROF: 
EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS
        (UIDXNAME(--------) VUSRPROF(ABCDPROF))
All users with profile ABCD*: 
EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS
        (UIDXNAME(--------) VUSRPROF(ABCD----))
All profiles for users USER001 and USER002: 
EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS 
        (UIDXNAME(USER001 USER002) VUSRPROF(--------))