Using SAS to analyze CICS input data for DAY040

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

Description

In some cases the input data does not have the correct record types for processing a cics regions data. The data dictionary records are missing. Using the below code you can analyze the data to determine if the dictionary records are missing.

Solution

//        job card                                      <=== change             
//MICSPP  JCLLIB ORDER=sharedprefix.MICS.PROCLIB        <=== change             
//S1  EXEC MICSSHRx                                     <=== change             
//*                                                                             
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *           
//*                                                                 *           
//*  This job lists out the 3 different types of SMF 110 records    *           
//*  that are critical to CA MICS processing.  These are            *           
//*                                                                 *           
//*    DATA DICT    -  Data dictionary (subtype 1, class 1)         *           
//*    PERFORMANCE  -  Performance (substype 1, class 3)            *           
//*    STATISTICS   -  Statistics (subtype 2)                       *           
//*                                                                 *           
//*  If no data dictionary records for a particular CICS region as  *           
//*  identified by an ORGSYSID/APPLID combination have been         *           
//*  input to the CA MICS database, then the CIC06024E message will *           
//*  appear during the DAILY or incremental update.  When you run   *           
//*  this job, you will see whether a data dictionary record was    *           
//*  available for a particular region.  The record number of the   *           
//*  data dictionary record should come before the record number    *           
//*  of the first performance record.                               *           
//*                                                                 *           
//*  The statistics records do not require data dictionary records. *           
//*                                                                 *           
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *           
//*                                                                             
//INSMF   DD DISP=SHR,DSN=your_SMF110_input             <=== change             
//SYSIN DD *                                                                    
  DATA DICT(KEEP=ORGSYSID ENDTS APPLID RECNUM CNTDICT)                          
       PERF(KEEP=ORGSYSID ENDTS APPLID RECNUM CNTPERF)                          
       STAT(KEEP=ORGSYSID ENDTS APPLID RECNUM CNTSTAT);                         
    INFILE INSMF LENGTH=LEN;                                                    
    INPUT @2 RTYPE PIB1.  @;                                                    
    LENGTH APPLID $ 8;                                                          
    IF LEN GE 30  THEN DO;                                                      
      INPUT @3 ENDTS SMFSTAMP8.  ORGSYSID $CHAR4.                               
        @19 SUBTYPE PIB2. @25 SMFAPS PIB4.  @ ;                                 
      RECNUM+1;                                                                 
      PTR=SMFAPS-1 ;                                                            
      PTRX=PTR;                                                                 
      PTR3=SMFAPS-3 ;                                                           
      INPUT @PTR3  CICSREL $CHAR2. @PTR APPLID  $CHAR8. @;                      
      PTR=SMFAPS+19;                                                            
      PTR=63 ;                                                                  
      INPUT @PTR  DCLASS PIB2.  @;                                              
      HOUR=HOUR(ENDTS);                                                         
      DATE=DATEPART(ENDTS);                                                     
      IF SUBTYPE EQ 1 AND DCLASS EQ 1 THEN DO;                                  
        CNTDICT=1;                                                              
        OUTPUT DICT;                                                            
      END;                                                                      
      ELSE                                                                      
        IF SUBTYPE EQ 1 AND DCLASS EQ 3 THEN DO;                                
          CNTPERF=1;                                                            
          OUTPUT PERF;                                                          
        END;                                                                    
        ELSE                                                                    
          IF SUBTYPE EQ 2 THEN DO;                                              
            CNTSTAT=1;                                                          
            OUTPUT STAT;                                                        
          END;                                                                  
    END;                                                                        
    FORMAT ENDTS  DATETIME22.2 DATE DATE9.;                                     
    RUN;                                                                        
  PROC SORT DATA=DICT;                                                          
    BY ORGSYSID APPLID RECNUM;                                                  
  PROC SORT DATA=PERF;                                                          
    BY ORGSYSID APPLID RECNUM;                                                  
  PROC SORT DATA=STAT;                                                          
    BY ORGSYSID APPLID RECNUM;                                                  
  PROC MEANS SUM MIN MAX NOPRINT DATA=DICT;                                     
    BY ORGSYSID APPLID;                                                         
    VAR CNTDICT RECNUM ENDTS;                                                   
    OUTPUT OUT=TOTDICT                                                          
           MIN=CNTMIN RECMIN STARTTS                                            
           MAX=CNTMAX RECMAX ENDTS                                              
           SUM=RECCNT;                                                          
  PROC MEANS SUM MIN MAX NOPRINT DATA=PERF;                                     
    BY ORGSYSID APPLID;                                                         
    VAR CNTPERF RECNUM ENDTS;                                                   
    OUTPUT OUT=TOTPERF                                                          
           MIN=CNTMIN RECMIN STARTTS                                            
           MAX=CNTMAX RECMAX ENDTS                                              
           SUM=RECCNT;                                                          
  PROC MEANS SUM MIN MAX NOPRINT DATA=STAT;                                     
    BY ORGSYSID APPLID;                                                         
    VAR CNTSTAT RECNUM ENDTS;                                                   
    OUTPUT OUT=TOTSTAT                                                          
           MIN=CNTMIN RECMIN STARTTS                                            
           MAX=CNTMAX RECMAX ENDTS                                              
           SUM=RECCNT;                                                          
  DATA COMBINE;                                                                 
    SET TOTDICT(IN=IN1) TOTPERF(IN=IN2)  TOTSTAT(IN=IN3);                       
    BY ORGSYSID APPLID;                                                         
    LENGTH RECTYPE $ 10;                                                        
    IF IN1  THEN  RECTYPE='DATA DICT';                                          
    IF IN2  THEN  RECTYPE='PEFORMANCE';                                         
    IF IN3  THEN  RECTYPE='STATISTICS';                                         
    FORMAT ENDTS STARTTS DATETIME22.2;                                          
  PROC PRINT SPLIT="*" DATA=COMBINE;                                            
    ID  ORGSYSID;                                                               
    VAR APPLID RECTYPE RECMIN STARTTS ENDTS RECCNT;                             
    LABEL RECTYPE="RECORD"*"TYPE"                                               
           RECMIN="FIRST"*"RECORD"*"NUMBER"                                     
           RECCNT="RECORD"*"COUNT"                                              
          STARTTS="FIRST"*"RECORD"*"TIMESTAMP"                                  
            ENDTS="FIRST"*"RECORD"*"TIMESTAMP"                                  
           APPLID="CICS"*"APPLID";                                              
    TITLE1 "ANALYSIS OF CMF TYPE 110 RECORDS";                                  
    TITLE2 "DATA DICTIONARY RECORDS FOR AN APPLID SHOULD COME";                 
    TITLE3 "BEFORE THE PERFORMANCE RECORDS FOR THAT APPLID";                    
    TITLE4 "STATISTICS RECORDS DO NOT REQUIRE DATA DICTIONARY RECORDS";         
    RUN;                                                                        
/*                                                                              
//