How can a TPX batch report be tailored to accommodate same variable across multiple lines
search cancel

How can a TPX batch report be tailored to accommodate same variable across multiple lines

book

Article ID: 280081

calendar_today

Updated On:

Products

TPX - Session Management

Issue/Introduction

In case a long variable line is needed when running a batch report, such as printing all profiles (variable &VUSR$PRF) that have been assigned to an user. How to proceed?

Environment

Release : 5.4

Component : TPX for z/OS

Resolution

In a batch report, it is not possible to directly continue the text from the same variable across more than one line of SYSIN input.

This document outlines an alternative method:



Specify SYSIN DD to point to a data set that has LRECL of the desired report width.

As documented in Formatting a Field Longer than 78 Characters: Use a SYSIN control file with an LRECL greater than 80.

For example, if a report line will be 132 characters long, then define a data set with LRECL 148 or longer so that is long enough to accommodate a statement:

NOTE: It is not possible to simply have the JCL in a large LRECL dataset and use SYSIN DD * as this will not work. The JCL must specify:

//SYSIN DD DSN=long.lrecl.dataset,DISP=SHR



JCL sample:

//*                                                          
//* USERS WITH ALL PROFILES - LONG LIST MUST USE SYSIN       
//*                                                          
//*                                                        
//BATCHADM EXEC  tpxproc,VNODE='*BATCH*'                    
//EXTFILE  DD DSN=the.ext.file,DISP=(,CATLG,KEEP),        
//      DCB=(RECFM=FB,LRECL=8000,BLKSIZE=15000,DSORG=PS),    
//      UNIT=SYSDA,SPACE=(CYL,(20,5))                        
//RPTFILE DD DSN=the.rep.file,DISP=(,CATLG,KEEP),    
//      DCB=(RECFM=FB,LRECL=8000,BLKSIZE=13300,DSORG=PS),    
//      UNIT=SYSDA,SPACE=(CYL,(20,5))                        
//SYSIN    DD DSN=long.lrecl.dataset(member),DISP=SHR                                             
//

 


SYSIN  sample:

C                                              
EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS   
(UIDXNAME(--------) VUSRPROF(--------))        
C                                              
SET RTITLE1                                                         
'  USERID  1ST PROF|2ND PROF|3RD PROF|4TH PROF|5TH PROF'            
SET RTITLE2 ' -------- -------- -------- -------- -------- --------'
REPORT GIVING(RPTFILE) USING(EXTFILE)                               
(                                                                   
('0&UIDXNAME   ')                                                   
('          &VUSR$PRF                                   ')          
(' &UIDXSTIC   ')                                       
)                                                                            


Note: The print area to list the profiles is limited by the spaces between the two ‘’ (actual print area highlighted in black below). When all the space is filled up, the print will stop for that variable. To increase the coverage, adjust the spaces accordingly by moving ') to the right.



Sample Report
Printing the sample above produces the following output:

********************************* Top of Data ********
USERID  1ST PROF|2ND PROF|3RD PROF|4TH PROF|5TH PROF
-------- -------- -------- -------- -------- --------
0userid01                                            
         PROFIL01 PROFIL02 PROFIL03 PROFIL04 PROFIL05
Y                                                                                                      
0userid02                                             
         PROFIL02 PROFIL05
Y                                                   
0userid03                                            
         PROFIL03                                      
Y
                                                   

 

IMPORTANT NOTE:
Each variable has a maximum length value (See Variables with a Length Greater than Nine) . That means that if there are users with variables that go beyond the maximum length, it won’t be possible to print those on the report.

EXAMPLE:

VUSR$PRF variable is a list of all the profiles that are assigned to the user. The length of the value depends upon the number of profiles that are assigned to the user.
The maximum length of this variable is 255 bytes.

Meaning that if there are users which the number of profiles assigned go beyond 255 bytes, it won’t be possible to print them all on the report.

The maximum number of profiles that can be listed on the report is 25 profiles (Each profile having 8 chars + 2 spaces in between).

SYSIN to list the maximum number of profiles possible:

----+----1-- …    250----+----6
...
(' &VUSR$PRF …               ') 
... 

Note that ') is located in columns 259 and 260.