Shared Appendix 10: Exits for the Process Task -- Open Systems and Windows NT Specifics

Table Of ContentsIT Service Vision Help


Index to Topics in this File:

Contents of this File:

New-Style Process Exits

Location and Purpose of Process Exit Points


               Exit        Placement     Purpose        Frequency
               Point                                    of
               Name                                     Execution

               proc100     Directly      Enables        Once per
                           after the     post-sort      table.
                           RUN statement processing
                           for the PROC  of the
                           SORT of the   staged data.
                           staged data.

               proc125     Directly      Allows         Once per
                           before        setting of     table.
                           the "merge"   options
                           DATA          and open
                           step.         DATA step
                                         code prior
                                         to the
                                         merge of
                                         the detail-
                                         level and
                                         staged data.

               proc135     Directly      Allows the     Once per
                           before the    user to        table.
                           closing ;     add his/her
                           in the DATA   own output
                           statement.    data sets.

               proc180     Duplicate      Enables user    Open data
                           observation    prevent the     step code
                           already in     automatic       and is run
                           detail.        deletion of     once per
                                          observations    observation.
                                          that duplicate
                                          those already
                                          in DETAIL. Set
                                          _delobs to 0 to
                                          prevent deletion
                                          of duplicate
                                          obs. By default
                                          _delobs is set
                                          to 1.

               proc200     When the      Allows user    Once per
                           observation   code to be     observation
                           is            executed       read
                           found         each time      from the
                           to have       an output      staged
                           come from     observation    data set.
                           the new       is
                           (staged)      found
                           data set.     to have
                                         come from
                                         the new
                                         (staged)
                                         data set.
                                         A count of
                                         these
                                         observations
                                         is
                                         accumulated
                                         in the
                                         variable
                                         _addobs .

               proc205     Directly      Allows the     Once per
                           before        user to        observation.
                           the           modify the
                           OUTPUT        observation
                           statement     before it
                           on the        is finally
                           "merge"       written to
                           DATA          the detail
                           step.         level.

               proc230     After         Enables return Once per
                           processing    code setting   table.
                           has been      or other final
                           completed     operations.
                           for all
                           tables.

For more details about the locations of the exit points:

   Process Exits for Open Systems

   The following is an overview of the logic of %CSPROCES with the
   locations of the four exit points supported by IT Service Vision for
   Open Systems and Windows NT inserted.  Exit points are indicated by <<< procnnn >>>
   where nnn is the three digit exit number.

   Note that Open Systems and Windows NT IT Service Vision supports exits 100, 125,
   135, 200, 205, and 230 only.

   * Read raw data into staging data set;
   FILENAME RAWDATA ... ;
   DATA COLLECT.<table> ... ;
   RUN ;

   * Sort staged data to prepare for merge with DETAIL;
   PROC SORT DATA=COLLECT.<table>D ... ;
   RUN ;
   <<< proc100 >>>       * Exit 100 is after the sort ;

   <<< proc125 >>>       * Exit 125 is before merge ;

   * Merge DETAIL with COLLECT;
   DATA DETAIL.<table>D ( KEEP= <all vars to keep in the table> )
      <<< proc135 >>>   /* Exit 135 is before end of DATA stmt */
      ;
      SET COLLECT.<table>_ (IN=FROMNEW) ... ;
      ...
      <<< proc180 >>>    * Exit 180 allows duplicate obs to be kept;
      ...
      IF FROMNEW THEN DO;
         <<< proc200 >>> * Exit 200 knows observation from COLLECT;
      END;
      ...

      <<< proc205 >>>    * Exit 205 is directly before OUTPUT DETAIL;
      OUTPUT DETAIL.<table>D;
      ...
      RUN;
     <<< proc230 >>>   * Exit 230 is after all tables have been processed ;

Example

The following is an example of creating and invoking the proc200 exit:

   /* list of global macro variables that are needed */
     %global CPTABLE;

   * This example converts metrics from an older version of the performance
     data collector (HP PCS) into their equivalent values in a newer version
     of the collector (HP MeasureWare);

   * Allocate the PDB;
   %CPSTART( pdb=/my/pdb, mode=batch, access=write );

   * Create exit code for PCSGLB that maps PCS metrics to their MWA equivalents;
   %CPCAT ; cards4 ;

     * Define a macro to convert certain PCS global metrics to MWA equivalent;
     %macro FIXPCS ;

         %* Only do this for table PCSGLB;
         %if %UPCASE(&CPTABLE)=PCSGLB %then %do ;
           * Calculate the sum of these 6 metrics minus the (alleged) total;
           _d_i_f_f = abs( sum( GLBCSW,  GLBINT,  GLBSYS,
                                GLBRTIM, GLBNICE, GLBUSER ) - GLBCPTO );
           * This detects old-style data;
           if (_d_i_f_f<0.00001 or
              (GLBCPTO=1 and _d_i_f_f<0.1)) and
              GLBSCUT=. and GLBNMUT=. then
              do ;
                * Convert PCS metrics into their MWA form ;
                GLBSCUT=GLBSYS ;
                GLBNMUT=GLBUSER ;
                GLBSYS=GLBCSW + GLBINT + GLBSCUT ;
                GLBUSER=GLBRTIM + GLBNICE + GLBNMUT ;
              end ;
           drop _d_i_f_f ;
         %end ;
     %mend FIXPCS ;

     %FIXPCS ;
   ;;;;

   * Store the exit source in catalog WORK.PROCRED in entry PROC200.SOURCE;
   %CPCAT( cat=work.procred.proc200.source ) ;

   * Process the data;
   %CSPROCES( /my/extracted/data,
              *,
              exitsrc=work.procred,
              collectr=HP-PCS );

Old-Style Process Exits

Note: Although the functionality of the "old-style" exit points will be made available using the "new style" of exits points in a future release, the older form described here will continue to be supported in IT Service Vision indefinitely.

For information about the old-style exit points:

   OPEN SYSTEMS OLD-STYLE EXIT FACILITY


   OVERVIEW

   Three exit points exist for processing data from Cabletron
   SPECTRUM, HP Network Node Manager, IBM NetView for AIX, and SunNet
   Manager.  These points allow the inclusion of user-developed
   SAS statements at a point directly before an observation read from
   the raw input file is output to the staging data set
   (COLLECT.tablenm).

   These exit points are included for compatibility with older
   releases of IT Service Vision and, though they will continue to be
   supported, should not be preferred to the newer exit point
   strategy that utilizes the EXITLIB= parm on the %CSPROCES macro.

   The newer style exit points are described in other Help files.

   At the old style exit point for each of these collectors, catalog
   entries named in this manner:

     SITELIB.CSEXITS.CS<tablenm>.SOURCE then
     DICTLIB.CSEXITS.CS<tablenm>.SOURCE

   are included (if they exist) in the SAS code generated by
   %CSPROCES.  If both entries exist, both are included.  Any
   syntactical or semantic errors introduced into %CSPROCES by the
   statements in these entries are entirely the responsibility of
   the user, as are their upkeep and transport should the PDB be
   copied.


   USAGE

   The exits generally should be used to set data values in the
   observation from information available in that one observation
   (such as the value of a user-added variable).  The data has not
   gone through standard %CSPROCES data cleanup at this point.  This
   has little effect for COLLECTOR=HP-OV, but for COLLECTOR=SPECTRUM
   and COLLECTOR=SUNETMGR this means that C2RATE variables have not
   been converted to rates and the value of DURATION has not been set.
   The exits should not be used to remove observations from the input
   data.  Rather, the SUBSET= parameter in the %CSPROCES macro should
   be used.


   FUTURE

   The function of this exit facility will be replaced in a future
   release by one that includes more exit points and the ability to
   specify a personal exit library.  Though the old-style exit points will
   continue to be supported, they will not be updated to exploit new
   functionality in IT Service Vision.


   EXAMPLE

   ****************************************************************;
   * This example adds an exit for HP-OV data ;
   ****************************************************************;

   * Define new PDB with added variable for department code;
   x "rm -r /usr/tmp/pdb-exit";
   %CPSTART( pdb=/usr/tmp/pdb-exit, mode=batch );
   %CPCAT; cards4;
     delete table name=hn2sys noerror;
     add table name=hn2sys ;
       create variable name=udept extname=DEPT type=character
              interpret=string  length=16
              kept=yes label='Dept' description='Department' ;
     update table name=hn2sys
       /* Do not change BY list for HP-OV tables */
       day    =( classvars= 'udept machine datetime hour shift' )
       week   =( classvars= 'udept machine datetime hour shift' )
       month  =( classvars= 'udept machine datetime hour shift' )
       year   =( classvars= 'udept machine datetime hour shift' )
       ;
   ;;;;
   %CPCAT( cat=work.temp.exitdutl.source );
   %CPDDUTL( entrynam=work.temp.exitdutl.source, list=y );

   * Save the exit statements in dictlib with the proper name;
   %CPCAT; cards4;

     *-------------------------------------;
     * User exit to set UDEPT from MACHINE.;
     *-------------------------------------;
     retain _u_cnt_ 0;   * This risks varname collision!;;
     select ;
       when (scan(machine,1) in ('dali' 'trinity'))
             udept = 'Personnel';
       when (machine =: 'R' )
             udept = 'Research';
       when (machine = 'henry')
             udept = 'Facilities';
       otherwise do;
         _u_cnt_ + 1;    * Warn of unknown dept only 25 times;
         if _u_cnt_<=25
           then put "WARNING: Unrecognized " machine=;
         udept = 'Unknown';
       end;
     end;
     *-------------------------------------;
     * End user exit code.                 ;
     *-------------------------------------;

   ;;;;
   %CPCAT( cat=dictlib.csexits.cshn2sys.source );

   * Process HP-OV data;
   %let csdelcol=0;   * Opt for debug: Suppress COLLECT cleanup;
   %let cp_nmsg=2;    * Opt for debug: Show generated DATA step;
   %CSPROCES( <rawdata>,
              hn2sys,
              collectr=HP-OV,
              subset=udept^="Unknown" );
   %let csdelcol=2;   * Reset to default;
   %let cp_nmsg=1;    * Reset to default;

   %CPREDUCE;