Recommended procedure to REORG TPX VSAM ADMIN1/ADMIN2 databases
search cancel

Recommended procedure to REORG TPX VSAM ADMIN1/ADMIN2 databases


Article ID: 229752


Updated On:


TPX - Session Management


When there have been significant changes to the TPX VSAM files, such as adding a large number of new Users or if data problems have been identified then it is best to reorganize the VSAM files (REORG).

Business requirements often limit the amount of time that TPX can be unavailable, hence to minimize the down time, these instructions identify what steps can be taken to process a TPX database REORG.

TPX needs to be down when running IDCAMS for backup, Rename and the TPX RESET INTEGRITY job.

Suggest attempting this procedure during a time of low system activity.



Release : 5.4

Component : TPX for z/OS


TPX needs to be quiesced for the entire sequence of the REORG in order to maintain the integrity of the current data.

Follow steps described below to REORG the VSAM:

Stop TPX.

Backup of the VSAM file first, DATA Component.
IDCAMS REPRO the '**.DATA' , component to a flat file. (The 'DATA' only is required so the Index is rebuilt when the sorted flat file is repro'd to the new vsam).

You can use the following JCL samples:

  • CB0VJCL(LSBACKUP) if the TPX files are managed by Lserv.    

# Example:  
                                                     ensure 50% free space

3) Sort the new flat file.
Since the records are unloaded in non-sequenced order, they need to be sorted.  

This becomes imperative if: 
-  An issue has been identified with VSAM files.
-  or the VSAM files need to be reorg (too many CA splits or extensions) 
-  or used utility other than IDCAMS REPRO (UNLOAD) to create the flat file backup.

Sort starting at position 9 for a length of 17 in ascending order
DFSORT examples:  
     SORT FIELDS=(9,17,CH,A)

JCL Sample:

//SORTA1   EXEC PGM=SORT                                          
//SYSPRINT DD  SYSOUT=*                                           
//SYSOUT   DD  SYSOUT=*                                           
//SORTOUT  DD  DSN= TPX.PROD.ADMIN2.FLATFILE.SRT,         ---> Output file
//             DISP=(,CATLG,DELETE),
//             UNIT=SYSDA,DCB=(RECFM=VB,LRECL=8000,BLKSIZE=8004), 
//             SPACE=(TRK,(xx,xx)),VOL=SER=(xxxxxxx)                 
//SORTWK01 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK02 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK03 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK04 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK05 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SORTWK06 DD  UNIT=3390,SPACE=(CYL,(10,10))                      
//SYSIN DD *                                                      
 SORT FIELDS=(9,17,A),FORMAT=BI                 ---> Sort statements                  


4) Define a new ADMIN2 VSAM file.
Sample JCL member for cluster definition (VADMIN1/VADMIN2/VMAIL/VNOTES/VVIEW) can be found in the CB0VJCL library.

# Example:  

5) Restore the VSAM file from the data segment of the sorted backup file.

IDCAMS REPRO sorted flat file to temporary NEW VSAM file.
- JCL Sample found at CB0VJCL(VRESTORE).
- If you are using L-SERV to manage VSAM files, use member LSBACKUP instead of this job.

# Example:  

6)  IDCAMS RENAME the VSAM datasets.
           a) Rename TPX.PROD.ADMIN2   to   TPX.PROD.ADMIN2.OLD
           b) Rename TPX.PROD.ADMIN2.

7) Run the RESET INTEGRITY job.
- Verify RC=0  
the sample batch job is available in - hilvl.CB0VSRC(BATCHINI)

Start TPX.

9) Verify if TPX is working as expected.  

If for any reason the changes need to be backed out:

1) Stop TPX
2) Reverse the IDCAMS RENAME to reinstate the original file.
4) Start TPX


  • Use ONLY IDCAMS to implement the above steps.  
  • This Knowledge article is specific to ADMIN1and ADMIN2 TPX VSAM DATABASE REORG.
  • TPX Users and Profiles are maintained in the ADMIN2 database.

See Article 229806 on how to REORG the Notes / View / Mail TPX VSAM databases.

Additional Information

Please refer to the following for more information:

Under Best Practices, Performance and Maintenance.

Regular VSAM Maintenance for CA TPX Session Management VSAM Files

How do I keep my CA TPX Session Management related VSAM files in healthy  shape?

What are the considerations for running TPX without shutdown for extended periods of time?

What does the TPX RESET INTEGRITY batch job BATCHINI provide and when should it be run ?