Using JREPORTs, how can one produce a report containing only the BFOR and AFTR records belonging to a specific PROGRAM-NAME?

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

Question 

Using JREPORTs, how can one produce a report containing only the BFOR and AFTR records belonging to a specific PROGRAM-NAME?

Answer: 

BFOR and AFTR records do not contain a field for the PROGRAM-NAME that could otherwise be used as selection criteria.

First run a JREPORT 001 to find the TRANSACTION ID associated with the desired program name. Second run a JREPORT 008 to select all of the BFOR/AFTR records for the TRANSACTION ID of the desired program name that was discovered by running the JREPORT 001.

To better illustrate, below are examples of the input to JREPORT 001, JREPORT 008 and an example of the resulting reports:

STEP I.

 

Run JREPORT 001 to discover the TRANSACTION ID of the desired PROGRAM NAME:

//SYSIN   DD *               
 DATABASE DICTNAME=SYSDIRL   
 INPUT 8000 8000 UM(CULLJRNL)
JREPORT=1                    
/*                           

Sample of the resulting JREPORT 001 report:

   PROGRAM             TRANSACTION
     NAME       NODE        ID    
                                  
   RHDCRUAL   SYST1500       3451 
   RHDCRUAL   SYST1500       3452 
   USDMAIN0   SYST1500       3458 
   USDPROF0   SYST1500       3455 
   USDPROF0   SYST1500       3456 

The PROGRAM NAME that I am interested in selecting the BFOR and AFTR records for is USDMAIN0. As input to my JREPORT 008 I will place selection criteria on the TRANSACTION ID of the USDMAIN0 program which is 3458 as determined by JREPORT 001.

STEP II.

Run JREPORT 008 selecting the BFOR and AFTR records that are equal to the TRANSACTION ID of the program name discovered in JREPORT 001.

//SYSIN   DD *                        
 DATABASE DICTNAME=SYSDIRL            
 INPUT 8000 8000 UM(CULLJRNL)         
JREPORT=008                           
 SELECT TYPE EQ ('BFOR' 'AFTR') AND   
*       TRANSACT-ID EQ 3458           

The resulting report will contain only the BFOR and AFTR records for the TRANSACTION ID belonging to the desired program name:

Sample JREPORT 008 report: 
REPORT NO. 08                                     IDMS JOURNAL REPORT   
JREPORT 008                                           
FORMATTED RECORD DUMP
                                                                        
 JOURNAL    NODE       UTC         UTC       JOURNAL    TRANSACT     PG 
  RECORD    NAME       DATE        TIME      SEQUENCE      ID       GRP 
                                                                        
   BFOR   SYST1500   12/01/03  23.14.04.06       62785       3458       
          THIS IS A NATIVE IDMS RECORD                                   
          PG DISPLACEMENT            PREFIX LENGTH              
          USER RECORD ID             USER RECD LENGTH        42 
                                                                
        *** THIS IS ONLY THE FIRST PART OF THIS    BFOR  RECORD.
                                                                
       USER RECORD   DB KEY 01259509     (PAGE      75157 LINE  
              CHAR                                              
              ZONE   04000000000000000000                       
              NUMR   04000000000000000000                       
                    01...5...10....5...20                       
  BFOR   SYST1500   12/01/03  23.14.04.06       62786       3458
         THIS IS A NATIVE IDMS RECORD                           
     860  PG DISPLACEMENT         16 PREFIX LENGTH              
     450  USER RECORD ID          92 USER RECD LENGTH        42 
                                                                
        *** THIS IS ONLY THE FIRST PART OF THIS    BFOR  RECORD.
       USER RECORD   DB KEY 01259508     (PAGE      75157 LINE     8
              CHAR                                                  
              ZONE   029002900290029005000000000000000000           
              NUMR   155015551558155804000000000000000000           
                    01...5...10....5...20....5...30....5.           
  AFTR   SYST1500   12/01/03  23.14.04.06       62787       3458    
         THIS IS A NATIVE IDMS RECORD                               
     860  PG DISPLACEMENT         16 PREFIX LENGTH                  
     450  USER RECORD ID          92 USER RECD LENGTH        42 VERB
                                                                    
        *** THIS IS ONLY THE FIRST PART OF THIS    AFTR  RECORD.    
                                                                    
       USER RECORD   DB KEY 01259508     (PAGE      75157 LINE     8
              CHAR                                                  
              ZONE   029002900290029005000000000000000000           
              NUMR   155915551558155804000000000000000000           
                    01...5...10....5...20....5...30....5.    

Additional Information:

See CA IDMS REPORTs Guide, Chapter 8, for a complete description of field names within each journal record