14.03.2014 Views

Using JMP - SAS

Using JMP - SAS

Using JMP - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

436 Formula Functions Reference Appendix B<br />

Date Time Functions<br />

Abbrev Date, Long Date, Short Date<br />

The argument for these date functions is a <strong>JMP</strong> date. They return character strings that are the formatted<br />

representation of the argument. For example:<br />

• Abbrev Date(2752272000) returns Wed, Mar 20,1991.<br />

• Long Date(2752272000) returns Wednesday, March 20, 1991.<br />

• Short Date(2752272000) returns 3/20/91.<br />

Format<br />

The first argument in the Format function is a <strong>JMP</strong> date. This function returns the character string<br />

representation of the date by the date format that you specify in the second argument, which is a quoted<br />

string. If you apply this formula to a numeric column, <strong>JMP</strong> automatically changes the column’s data type to<br />

character.<br />

You can also supply a column for the first argument and leave the rest blank. The result is the formatted<br />

value of the column reference. This can be used to extract value labels of a column when the value labels are<br />

turned off.<br />

MDYHMS<br />

The argument of MDYHMS is a <strong>JMP</strong> date. This function shows all date and time fields, appending zeros as<br />

time fields if no time information is present. This is useful if a date column is formulated such that not all<br />

date information is displayed. The MDYHMS function can be used to see all available date and time<br />

information.<br />

Date Increment<br />

Adds 1 or more intervals to a starting datetime value. For example, Date Increment(Today(), "Day", 3) adds<br />

three days to the current date. Date Increment(Today(), "Year", 3) adds 3 years to the current date.<br />

Date Difference<br />

Returns the difference of two datetime values. The interval argument can be Second, Minute, Hour, Day,<br />

Week, Month, Quarter, Year. The alignment arguments are described here:<br />

Start<br />

Actual<br />

is used to count the number of times an interval starts.<br />

is used to count whole intervals.<br />

Fractional is used to count fractional intervals.<br />

For example, the following formula returns 207.890243055556, the number of days between the dates:<br />

Date Difference(01Jan2010:00:00:00, 27Jul2010:21:21:57, "Day", "fractional");<br />

The following formula returns 207, the number of completed days between the dates:<br />

Date Difference(01Jan2010:00:00:00, 27Jul2010:21:21:57, "Day", "actual");<br />

The following formula returns 9, the number of completed hours between the times:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!