|Tips for Working with the %CPDDUTL GENERATE SOURCE Control Statement|
Users who want to create their own table and variable definitions can do so from the following sources of information :
They can use the GENERATE SOURCE statement of the %CPDDUTL macro to build a first version of the CREATE TABLE, UPDATE TABLE, and CREATE VARIABLE statements needed to define the table. The generated source statements can be stored in either a SAS ® catalog member of type .SOURCE or in an external flat file.
Typically, a user would use GENERATE SOURCE when setting up to use a generic collector, in order to aid in defining the table to the PDB. As such, the data set used for staging the data for the generic collector would serve as the DATASET= parameter for the GENERATE SOURCE statement.
If you are required to use a staged data set as input to %CxPROCES you must ensure that it conforms to the following rules:
Once the source statements have been generated, they must be reviewed before being executed. While GENERATE SOURCE endeavors to be as accurate as possible, it is not infallible in some of the assumptions it makes. Specifically, the generated definitions should be examined to verify (and modify if necessary) the following things:
CREATE VARIABLE NAME=C EXTNAME=CEXT TYPE=NUMERIC LENGTH=8 INTERPRET=COUNT KEPT=YES SUBJECT='N/A' LABEL='Int var c' DESCRIPTION='Integer variable c' FORMAT=BEST12.2 ISTATS =( NOCOUNT SUM AVERAGE NOMAXIMUM NOMINIMUM NOUSS NOCV NORANGE NOVARIANCE NOSTD NONMISS ) DAY =( NOCOUNT SUM AVERAGE NOMAXIMUM NOMINIMUM NOUSS NOCV NORANGE NOVARIANCE NOSTD NONMISS ) WEEK =( NOCOUNT SUM AVERAGE NOMAXIMUM NOMINIMUM NOUSS NOCV NORANGE NOVARIANCE NOSTD NONMISS ) MONTH =( NOCOUNT SUM AVERAGE NOMAXIMUM NOMINIMUM NOUSS NOCV NORANGE NOVARIANCE NOSTD NONMISS ) YEAR =( NOCOUNT SUM AVERAGE NOMAXIMUM NOMINIMUM NOUSS NOCV NORANGE NOVARIANCE NOSTD NONMISS ) ;
For more information, see the online help entry "CPDDUTL Create Variable" in the Help Index.
By default, GENERATE SOURCE assigns interpretation type based on the following rules of thumb:
if ... assume interpretation type --------------------------- --------------------------- the variable format is DATETIMEx DATETIME the variable format is TIMEx TIME the variable format is DATEx DATE the variable format is PERCENTx PERCENT the variable label contains MINIMUM the strings MIN or MINIMUM or LWM or LOWEST the variable label contains MAXIMUM the strings MAX or MAXIMUM or HWM or PEAK or HIGHEST the variable label contains COUNT the string COUNT or TOTAL or PAGES the variable label contains DATETIME the string DATETIME the variable label contains TIME the string TIME the variable label contains DATE the string DATE the variable label contains PERCENT100 the string PCT or PERCENT or % or UTILIZ or UTILIS the variable label contains PERCENT the string RATIO the variable label contains GAUGE the string CURRENT or SIZE or GAUGE the variable label contains SUM the string SUM the variable label contains RATE the string PER or RATE or /HR or /HOUR or /MIN or /SEC the variable label contains AVERAGE the string AVG, AVERAGE, or MEAN or AVE the variable label contains INT the string VERSION or NUMBER or TYPE or CLASS or PRIORITY or PTY
For more information about selecting appropriate variable interpretation types, see the help entry "Variable Interpretation & Default Stats" from the IT Service Vision Help Index or File 5.INTERP.
The syntax of the GENERATE SOURCE statement is as follows:
GENERATE SOURCE < NAME= new-table-name > TABLE= < input-table-name | _ALL_ > |
DATASET= 'input-SAS-data-set-name' | INFILE= 'input-file-name' < TYPE= INTERVAL | EVENT > < INTYPE= DSI > see comments below ENTRYNAME= 'output-SAS-catalog-entry' FILENAME= 'output-physical-file-name' < DATETIME= variable-name > < DURATION= variable-name > < REPLACE | NOREPLACE > < NOERROR > ;
where the parameters are as follows:
Names the table to use in the CREATE TABLE NAME= statement that is generated. The table name must be unique within the PDB.
When TABLE= is specified and NAME= is not specified, the input-table-name on the TABLE= parameter is used.
When DATASET= is specified and NAME= is not specified, the name is formed by concatenating 'U' to the first six characters of the input-SAS-data-set name.
Names the PDB's IT Service Vision table to use as input for the creation of the dictionary control statements. This table must already exist in the PDB.
Names the SAS data set to use as input for the creation of the dictionary control statements. This data set must be defined in a SAS library. This parameter must be enclosed in single quotes.
Names a file (normally a text file) that contains syntax that GENERATE SOURCE has been designed to recognize. This parameter requires that the INTYPE parameter be specified so that GENERATE SOURCE knows what format to expect the text file.
Only valid when DATASET= or INFILE= are also specified. Sets the type of the table whose source is being generated. The default type is EVENT.
Only valid when INFILE= is also specified. This parameter is used to indicate the source of the file pointed to by the INFILE= statement so that GENERATE SOURCE knows how to process the input file. At the time of writing, DSI is the only INTYPE that can be specified although we expect to add to this in the future.
Names the destination source catalog entry to receive source control statements. This parameter must be enclosed in single quotes.
Names the destination file to receive source control statements. This parameter must be enclosed in single quotes.
Specifies an alternative variable to represent the default DATETIME variable.
Specifies an alternative variable to represent the default DURATION variable.
When REPLACE is used, any existing source in either a catalog or a file will be replaced. When NOREPLACE is use, new source will be appended to the existing source, if there is existing source entry, or will start a new source entry if there is no existing source entry with that name.
Indicates that errors caused by this statement should not cause subsequent %CPDDUTL control statements to be skipped.