C:\DataMarts\MyAdapter, and your libref is stg1357, then specify this library
path as C:\DataMarts\MyAdapter\stg1357.
attrib DATETIME length = 8
format = NLDATM.
label = 'Datetime'; LSTPDATE = datetime();
attrib LSTPDATE length = 8
format = NLDATM.
label = 'LastProcessDate';
attrib DURATION length = 8
format = TIME8.
label = 'Duration'; |
Column Name
Length
Format
|
SAS IT Resource Management
Formula
|
Description
|
|---|---|---|
|
DATETIMEFIFTEENMIN
Length: 8
Format: NLDATM.
|
DatetimeFifteenMinute
|
DatetimeFifteenMinute
|
|
DATETIMEFIVMIN
Length: 8
Format: NLDATM.
|
DatetimeFiveMinute
|
DatetimeFiveMinute
|
|
DATETIMEONEMIN
Length: 8
Format: NLDATM.
|
DatetimeOneMinute
|
DatetimeOneMinute
|
|
DATETIMETENMIN
Length: 8
Format: NLDATM.
|
DatetimeTenMinute
|
DatetimeTenMinute
|
|
DATETIMETHIRTYMIN
Length: 8
Format: NLDATM.
|
DatetimeThirtyMinute
|
DatetimeThirtyMinute
|
|
DATETIMETWENTYMIN
Length: 8
Format: NLDATM.
|
DatetimeTwentyMinute
|
DatetimeTwentyMinute
|
|
DAYDATE
Length: 8
Format: NLDATE10.
|
DayDate
|
DayDate
|
|
DAYOFMONTH
Length: 8
Format: 2.
|
DayOfMonth
|
DayOfMonth
|
|
DAYOFWEEK
Length: 8
Format: WKD.
|
DayOfWeek
|
DayOfWeek
|
|
HOUR
Length: 8
Format: 2.
|
Hour
|
Hour
|
|
MONTHDATE
Length: 8
Format: NLDATE10.
|
MonthDate
|
MonthDate
|
|
SHIFT
Length: $1
Format: $CHAR1.
|
Shift
|
Shift
|
|
TIME
Length: 8
Format: TOD5.
|
Time
|
Time
|
|
WEEKDATE
Length: 8
Format: NLDATE10.
|
WeekDate
|
WeekDate
|
|
YEARDATE
Length: 8
Format: NLDATE10.
|
YearDate
|
YearDate
|
1+1, and you want
another computed column called B that is A+5,
then the expression for B should be (1+1)+5,
not A+5.
if 1/A (A ne 0) then B=1/A; else B=0;This code prevents division by zero, which causes errors when the code runs.
Yes:
Yes.
This setting displays all the parameters that are available for the
User-Written Staging transformation. If Enable duplicate
checking is set to No,
none of these parameters appear.
%RMDUPDSN(SOURCE=USR)
data stage.stageTable1
stage.stageTable2;
data stage.stageTable1
stage.stageTable2
%RMDUPDSN(SOURCE=USR); %RMSETFTR;
%_ITMS_futureData;
abort
cancel 8;).
%rcSet(8);You can use the following code to set the return code to the error code from the proceeding DATA step or PROC step.
%rcSet(&syserr).;
options fmtsearch=(admin.formats sashelp.itms_formats);
options insert=(fmtsearch=(mylib.formats));
/* ********************************************************** */
/* Name: UserWrittenStaging */
/* ---------------------------------------------------------- */
/* Description: */
/* Reads the raw data from the rawdata.txt file that is in */
/* this format: */
/* ddMONyyyy:hh:mm machineName metric1 metric2 */
/* ddMONyyyy:hh:mm machineName metric1 metric2 */
/* <etc.> */
/* ********************************************************** */
libname staging 'c:\UserWritten\Staging';
data staging.metric1 (keep = datetime machine
metric1 lstpdate)
staging.metric2 (keep = datetime machine
metric3 lstpdate);
attrib datetime label = "DateTime" format = datetime18.;
attrib machine label = "Machine" length = $20;
attrib metric1 label = "Metric1" format = NLNUM16.;
attrib metric3 label = "Metric2*100" format = NLNUM16.;
attrib lstpdate label = "LastProcessDate" format = NLDATM.;
attrib metric2 format = NLNUM16.;
lstpdate = datetime(); /* needed for aggregation */
infile "c:\UserWritten\rawdata.txt" missover;
input datetime datetime15. machine metric1 metric2;
metric3 = metric2 * 100;
output staging.metric1
staging.metric2;
run;
/* ************************************************************** */
/* Name: UserWrittenStaging */
/* -------------------------------------------------------------- */
/* Description: */
/* Reads the rawdata from the rawdata.txt file that is in */
/* this format: */
/* ddMONyyyy:hh:mm machineName metric1 metric2 */
/* ddMONyyyy:hh:mm machineName metric1 metric2 */
/* <etc.> */
/* ************************************************************** */
/* ***PUT CODE INTO A MACRO IN ORDER TO USE %DO STATEMENTS*** */
%macro readRawdata;
/* libname staging 'c:\UserWritten\Staging'; */
data
/* ***GENERATE TABLE NAMES WITH OPTIONS AND KEEP LISTS*** */
%do i = 1 %to &numTargets;
&&target&i (%_ITMS_tableOptions(targetTableNum=&i,
generateTableName=NO)
keep = %_ITMS_columnList(targetTableNum=&i))
%end;
/* ***DUPLICATE CHECKING OUTPUT TABLE*** */
%RMDUPDSN(SOURCE=USR)
/* staging.metric1 (keep = datetime machine */
/* metric1 lstpdate) */
/* staging.metric2 (keep = datetime machine */
/* metric2 metric3 lstpdate) */
;
/* ***INITIALIZE DUPLICATE CHECKING*** */
%_ITMS_dupInit;
/* ***GENERATE ATTRIB STATEMENTS FOR COLUMNS IN OUTPUT TABLES*** */
%_ITMS_attrib();
/* attrib datetime label = "DateTime" format = datetime18.; */
/* attrib machine label = "Machine" length = $20; */
/* attrib metric1 label = "Metric1" format = NLNUM16.; */
/* attrib metric3 label = "Metric2*100" format = NLNUM16.; */
/* attrib lstpdate label = "LastProcessDate" format = NLDATM.; */
attrib metric2 format = NLNUM16.;
lstpdate = datetime(); /* needed for aggregation */
/* infile "c:\UserWritten\rawdata.txt" missover; */
/* ***USE &RAWDATA AND INCLUDE AN END-OF-FILE FLAG FOR*** */
/* ***DUPLICATE CHECKING*** */
infile "&rawdata" end = _eof missover;
input datetime datetime15. machine metric1 metric2;
/* ***RUN DUPLICATE CHECKING*** */
%_ITMS_dupCheck;
/* ***RUN FUTURE DATA CHECKING*** */
%RMSETFTR;
/* ***CREATE COMPUTED COLUMNS*** */
%_ITMS_computedColumns;
/* metric3 = metric2 * 100; */
/* ***OUTPUT DATA TO TARGET TABLES*** */
output
%do i = 1 %to &numTargets
&&target&i
%end;
;
/* output staging.metric1 */
/* staging.metric2; */
run;
/* ***UPDATE DUPLICATE CHECKING FILES*** */
%RMDUPUPD;
/* ***HANDLE FUTURE DATA*** */
%_ITMS_futureData;
%mend readRawdata;
%readRawdata; Domain
Categories. Within that folder, create one or more
folders for your domain categories. (A domain category is a way of
grouping different types of data such as System, Disk, or Network
data.) Specify a name for these categories that makes sense for your
application.
|
Aggregation Table Prefix
|
Date and Time Class
Columns
|
|---|---|
|
Day
|
DAYDATE
|
|
DayHour
|
DAYDATE HOUR
|
|
DayShift
|
DAYDATE SHIFT
|
|
DayShiftHour
|
DAYDATE SHIFT HOUR
|
|
Week
|
WEEKDATE
|
|
WeekHour
|
WEEKDATE HOUR
|
|
WeekShift
|
WEEKDATE SHIFT
|
|
WeekShiftHour
|
WEEKDATE SHIFT HOUR
|
|
Month
|
MONTHDATE
|
|
MonthHour
|
MONTHDATE HOUR
|
|
MonthShift
|
MONTHDATE SHIFT
|
|
MonthShiftHour
|
MONTHDATE SHIFT HOUR
|
|
Aggregation Table Prefix
|
Description
|
|---|---|
|
Detail
|
This data is not summarized.
It is left at the same level as the staging data.
|
|
KeyMetrics
|
Generally, this data
is summarized into the DAYDATE and HOUR level. It also includes a
limited number of metrics. This table usually keeps data for a longer
period than the other aggregations, so that it can be used in trending
and forecasting.
|
|
Summarization Level
of Aggregation Tables
|
Staging Column
|
Rank Column
|
Rank Column Label
|
|---|---|---|---|
|
For all aggregation
tables that are summarized at the Day level and more granular
|
DayDate
|
DayDateRank01
|
DayDateDescRank
|
|
For all aggregation
tables that are summarized at the Week level and more granular
|
WeekDate
|
WeekDateRank01
|
WeekDateDescRank
|
|
For all aggregation
tables that are summarized at the Month level and more granular
|
MonthDate
|
MonthDateRank01
|
MonthDateDescRank
|
|
Filter Name
|
Filter Expression and
Description
|
|---|---|
|
LastDay
|
Expression: <<aggTableNameDAYDATERANK01>>
= 1
Description: DayDateDescRank
1
|
|
Last3Days
|
Expression: <<aggTableNameDAYDATERANK01>>
between 1 and 3
Description: DayDateDescRank
1 – 3
|
|
RollingWeek
|
Expression: <<aggTableNameDAYDATERANK01>>
between 1 and 7
Description: DayDateDescRank
1 - 7
|
|
RollingMonth
|
Expression: <<aggTableNameDAYDATERANK01>>
between 1 and 31
Description: DayDateDescRank
1 - 31
|
|
Last14Days
|
Expression: <<aggTableNameDAYDATERANK01>>
between 1 and 14
Description: DayDateDescRank
1 - 14
|
|
Last90Days
|
Expression: <<aggTableNameDAYDATERANK01>>
between 1 and 90
Description: DayDateDescRank
1 - 90
|
|
Filter Name
|
Filter Expression and
Description
|
|---|---|
|
ThisWeek
|
Expression: <<aggTablenameWEEKDATERANK01>>
= 1
Description: WeekDateDescRank
1
|
|
LastWeek
|
Expression: <<aggTablenameWEEKDATERANK01>>
= 2
Description: WeekDateDescRank
2
|
|
Last2Weeks
|
Expression: <<aggTablenameWEEKDATERANK01>>
between 2 and 3
Description:WeekDateDescRank
2 - 3
|
|
Last4Weeks
|
Expression: <<aggTablenameWEEKDATERANK01>>
between 2 and 5
Description: WeekDateDescRank
2 - 5
|
|
Last12Weeks
|
Expression: <<aggTablenameWEEKDATERANK01>>
between 2 and 13
Description: WeekDateDescRank
2 - 13
|
|
Filter Name
|
Filter Expression and
Description
|
|---|---|
|
ThisMonth
|
Expression: <<aggTableName.MONTHDATERANK01>>
= 1
Description: MonthDateDescRank
1
|
|
LastMonth
|
Expression: <aggTableName.MONTHDATERANK01>>
= 2
Description: MonthDateDescRank
2
|
|
Last2Months
|
Expression: <<aggTableName.MONTHDATERANK01>>
= 2 - 3
Description: MonthDateDescRank
2 - 3
|
|
Last4Months
|
Expression: <<aggTableName.MONTHDATERANK01>>
= 2 - 4
Description: MonthDateDescRank
2 - 4
|
|
Last13Months
|
Expression: <<aggTableName.MONTHDATERANK01>>
= 2 - 14
Description: MonthDateDescRank
2 - 14
|