TPX Batch - example - How do I set a long title line or continue SET RTITLE1 across multiple lines?

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

Description:

You cannot directly continue the value of a single variable such as RTITLEx across more than one line of SYSIN input. This document outlines a couple of alternative methods:

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

  2. VDEFINE several shorter variables, then SET values and specify the variables in the report title

Solution:

You cannot directly continue the value of a single variable such as RTITLEx across more than one line of SYSIN input. This document outlines a couple of alternative methods.

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

    As documented in the CA TPX Batch Administration Guide, Formatting a Field Longer than 78 Characters: You must use a SYSIN control file with an LRECL greater than 80.

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

    SET RTITLE1 '<<132chars>>'

    NOTE: You cannot simply have your JCL in a large LRECL dataset and use SYSIN DD *. This will not work. The JCL must specify SYSIN DD DSN=long.lrecl.dataset,DSIP=SHR

    example://BATCHA   EXEC TPX,VNODE='*BATCH*'  //EXTFILE  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=SHR             //RPTFILE  DD SYSOUT=*                      //SYSIN DD DSN=userid.CNTL.LRECL256(SYSINLNG),DISP=SHR 

    EDIT userid.CNTL.LRECL256(SYSINLNG) - 01.05 Columns 00001 00072Command ===> Scroll ===> CSR ****** ***************************** Top of Data ******************************000001 C 000002 C Create report with long titles 000003 C 000004 EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS (UIDXNAME(--------)) 000005 C 000006 C Method A - Set a long value for RTITLEx 000007 C - Must have SYSIN DD specify data set with large LRECL (not DD *) 000008 C 000009 SET RTITLE1 000010 '1***** TITLE REPORT A: ' 000011 SET RTITLE2 000012 ' create with SYSIN statements in dataset that has large LRECL like this file that uses LRECL=256 so I can make this line very long as needed' 000013 REPORT GIVING(RPTFILE) USING(EXTFILE) ...

    Output: ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+....80...+....90...+....100..+....110..+....120..+...|130..+....140..+....150***** TITLE REPORT A: create with SYSIN statements in dataset that has large LRECL like this files that uses LRECL=256 so I can make this line very lon NOTE: Your site default for SYSOUT=* may be limited as in the above example where the defined RTITLE2 is truncated. (The "|" on the column count line indicates the end of the print line.)You may need to write your report to a data set with the required LRECL, or explicitly define a long LRECL on the output report file://RPTFILE DD SYSOUT=*,DCB=(LRECL=256) Note that specifying LRECL=256 on the SYSOUT=* only extended the print line below to 132 characters. Your shop standards may differ. Output: ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+....80...+....90...+....100..+....110..+....120..+....130|.+....140..+....150..+....***** TITLE REPORT A: create with SYSIN statements in dataset that has large LRECL like this files that uses LRECL=256 so I can make this line very long as
  2. VDEFINE several shorter variables, then SET values and specify the variables in the report title

    //BATCHB   EXEC TPX,VNODE='*BATCH*' //EXTFILE  DD UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD)                   //RPTFILE  DD SYSOUT=*   //SYSIN DD *                                                            C                                                                       C  Create report with long titles                                       C                                                                       EXTRACT GIVING(EXTFILE) USER AND NO SESSIONS (UIDXNAME(--------))       C                                                                       C  Method B - Set several 40 char variables then concatenate these      C in an RTITLE stmt                                                     C   - Variable names must be at least 2 chars in length (e.g. AA not A) C   - Must VDEFINE then SET                                             C                                                                       VDEFINE AA (LENGTH(40))                                                 VDEFINE BB (LENGTH(40))                                                 VDEFINE CC (LENGTH(40))                                                 SET AA 'AAAAAAAAAAaaaaaaaaaaAAAAAAAAAAaaaaaaaaaa'                       SET BB 'BBBBBBBBBBbbbbbbbbbbBBBBBBBBBBbbbbbbbbbb'                       SET CC 'CCCCCCCCCCccccccccccCCCCCCCCCCcccccccccc'                       SET RTITLE1                                                             '1***** TITLE REPORT B:'                                                SET RTITLE2                                                             ' VDEFINE variables with part of title line then use those in RTITLEx'  SET RTITLE3                                                             ' &AA &BB &CC '                                                         REPORT GIVING(RPTFILE) USING(EXTFILE)  ?                           Output: ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+....80...+....90...+....100..+....110..+....120|.+....130..+....140***** TITLE REPORT B:                    VDEFINE variables with part of title line then use those in RTITLEx AAAAAAAAAAaaaaaaaaaaAAAAAAAAAAaaaaaaaaaa BBBBBBBBBBbbbbbbbbbbBBBBBBBBBBbbbbbbbbbb CCCCCCCCCCccccccccccCCCCCCCCCCcccccccccc  NOTE: Reports that are wider than 132 characters may not be easy to read.  You may want to consider specifying multiple report lines for each extracted record. REPORT GIVING(RPTFILE) USING(EXTFILE)                                    (('0&UIDXNAME' '&VUSR$MAG                                           ') <<<line 1  ( '            &VUSR$PRF                                           ')) <<<line 2