ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

TPX Batch Administration; Deleting Profile Sessions example

book

Article ID: 241280

calendar_today

Updated On:

Products

TPX - Session Management

Issue/Introduction

A site may have a requirement to remove sessions that are no longer used from all the TPX profiles.  Since 

this may be a large number the preference is to do this in Batch.

Is there a way to accomplish this using Batch Administration?

Environment

Release : 5.4

Component : TPX for z/OS

Resolution

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

This example looks at ALL the profiles, and extracts those containing sessions starting with CMS or SCC:

//**** EXTRACT all matching sessions for CERTAIN profiles.
//****  Delete the specific sessions in a profile based on the extract file
//*
//BATCHADM  EXEC 'yourtpxproc',VNODE='*BATCH*'
//*  Write the  output to files or sysout
//*XTFIL1  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD)
//*EXTFIL1  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,CATLG),
//EXTFILE  DD DSN=userid.TPX.EXT1,DISP=(,CATLG,KEEP),
//      DCB=(RECFM=FB,LRECL=133,BLKSIZE=13300,DSORG=PS),
//      UNIT=SYSDA,SPACE=(CYL,(10,1))
//RPTFILE DD DSN=userid.TPX.RPT1,DISP=(,CATLG,KEEP),
//      DCB=(RECFM=FB,LRECL=133,BLKSIZE=13300,DSORG=PS),
//      UNIT=SYSDA,SPACE=(CYL,(10,1))
//SYSIN DD *
C
C
EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
    (PIDXNAME(--------) PENTUSER(CMS-----) PENTUSER(SCC-----))  PIDXNAME:profile PENTUSER: session
SET RTITLE1
' EXTRACT all sessions STARTING WITH CMS OR SCC'
SET RTITLE2
' Profile  SessionID ApplID       '
SET RTITLE3
' ======== ========= ========  =========  '
REPORT GIVING(RPTFILE) USING(EXTFILE)
    ((' &PIDXNAME' '&PENTUSER' ' &PENTAPPL' ' '))
C  DELETE TPX PROFILESESSION USING(EXTFILE)  (C is a comment) 

 

Notes:

1. Only run the extract/report first to ensure it is extracting what is expected.

2. As a TEST only extract, then DELETE 1 session from 1 profile:

    EXTRACT GIVING(EXTFILE) PROFILE AND MATCHING SESSIONS
    (PIDXNAME(PROF1TST) PENTUSER(CMS12345) ))  <<  Profile PROF1TST and the session is CMS12345.

3. Once the test is successful rerun the original extract with the DELETE PROFILESESSION uncommented.

4. The Delete statement can be used without doing an extract, the specific profile and session are specified.

    //SYSIN DD *

    DELETE PROFILESESSION (TESTPROF CA31)

                                                     PROFILE   SESSION

Additional Information

See the sections under Batch Variables for the various variables that can be used in Batch Reporting. Notice there are 'Profile Session' variables which are relevant in this example.

Delete Users, Profiles and Sessions