The CPM Procedure

Using the INTERVAL= Option

The INTERVAL= option enables you to define the units of the DURATION variable; that is, you can indicate whether the durations are specified as hours, minutes, days, or in terms of workdays, and so on. In addition to specifying the units, the INTERVAL= option also indicates whether the schedule is to be output as SAS time, date, or datetime values, or as unformatted numeric values.

The prefix DT in the value of the INTERVAL= option (as in DTDAY, DTWEEK, and so on) indicates to PROC CPM that the schedule is output as SAS datetime values, and the DATE= option is expected to be a SAS datetime value. Thus, use DTYEAR, DTMONTH, DTQTR, or DTWEEK instead of the corresponding YEAR, MONTH, QTR, or WEEK if the DATE= option is specified as a SAS datetime value.

The start and finish times for the different schedules computed by PROC CPM denote the first and last day of work, respectively, when the values are formatted as SAS date values. If the times are SAS time or datetime values, they denote the first and last second of work, respectively.

If the INTERVAL= option is specified as WORKDAY, the procedure schedules work on weekdays and nonholidays starting at 9 a.m. and ending at 5 p.m. If you use INTERVAL=DTWRKDAY, the procedure also schedules work only on weekdays and nonholidays. In this case, however, the procedure expects the DATE= option to be a SAS datetime value, and the procedure interprets the start of the workday from the time portion of that option. To change the length of the workday, use the DAYLENGTH= option in conjunction with INTERVAL=DTWRKDAY.

The procedure sets the default value of the INTERVAL= option on the basis of the units of the DATE= option. Table 4.4 lists various valid combinations of the INTERVAL= option and the type of the DATE= option (number, SAS time, date or datetime value) and the resulting interpretation of the duration units and the format type of the schedule variables (numbers, SAS time, date or datetime format) output to the Schedule data set. For each DATE type value, the first INTERVAL value is the default. Thus, if the DATE= option is a SAS date value, the default value of the INTERVAL= option is DAY, and so on.

For the first five specifications of the INTERVAL= option in the last part of Table 4.4 (DTDAY , …, DTHOUR), the day starts at daystart and is daylength hours long.

The procedure may change the INTERVAL= specification and the units of the schedule variables to be compatible with the format specification of the ALIGNDATE variable, or the A_START or A_FINISH variables in the Activity data set, or the PERIOD variable in the Resource data set. For example, if interval is specified as DAY, but the ALIGNDATE variable contains SAS datetime values, the schedule is computed in SAS datetime values. Similarly, if interval is specified as DAY or WEEKDAY, but some of the durations are fractional, the schedule is computed as SAS datetime values.

Table 4.4: INTERVAL= and DATE= Parameters and Units of Duration

DATE Type

INTERVAL

Units of Duration

Format of Schedule Variables

Number

 

Period

Unformatted

SAS time

HOUR

Hour

SAS time

 

MINUTE

Minute

SAS time

 

SECOND

Second

SAS time

SAS date

DAY

Day

SAS date

 

WEEKDAY

Day (5-day week)

SAS date

 

WORKDAY

Day (5-day week:

SAS datetime

   

9-5 day)

 
 

WEEK

Week

SAS date

 

MONTH

Month

SAS date

 

QTR

Quarter

SAS date

 

YEAR

Year

SAS date

SAS datetime

DTDAY

Day (7-day week)

SAS datetime

 

DTWRKDAY

Day (5-day week)

SAS datetime

 

DTSECOND

Second

SAS datetime

 

DTMINUTE

Minute

SAS datetime

 

DTHOUR

Hour

SAS datetime

 

DTWEEK

Week

SAS datetime

 

DTMONTH

Month

SAS datetime

 

DTQTR

Quarter

SAS datetime

 

DTYEAR

Year

SAS datetime