14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - 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.

592 JSL Syntax Reference Appendix A<br />

Date and Time Functions<br />

Returns<br />

A string representation of the date.<br />

Argument<br />

date Can be the number of seconds since the base date (midnight, January 1, 1904), or any date-time<br />

operator.<br />

Example<br />

Abbrev Date(29Feb2004)<br />

02/29/2004<br />

See Also<br />

Section on Date-Time formats in the <strong>Scripting</strong> <strong>Guide</strong>.<br />

Date Difference(datetime1, datetime2, "interval_name", )<br />

Description<br />

Returns the difference in intervals of two date-time values.<br />

Returns<br />

A number.<br />

Arguments<br />

datetime1, datetime2 Datetime values.<br />

"interval_name" A quoted string that contains a date-time interval, such as "Day" or "Hour".<br />

"alignment" An optional string. Options are as follows:<br />

– start counts the number of times the interval starts.<br />

– actual counts whole intervals.<br />

– fractional counts fractional intervals.<br />

Date DMY(day, month, year)<br />

Description<br />

Constructs a date value from the arguments.<br />

Returns<br />

The specified date, expressed as the number of seconds since midnight, 1 January 1904.<br />

Arguments<br />

day number, day of month, 1-31. Note that there is no error-checking, so you can enter February 31.<br />

month number of month, 1-12.<br />

year number of year.<br />

Date Increment(datetime, interval, , )<br />

Description<br />

Adds 1 or more intervals to a starting datetime value.<br />

Returns<br />

Returns the new datetime value.

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

Saved successfully!

Ooh no, something went wrong!