14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6 Types of Data 115<br />

Date-Time Functions and Formats<br />

Table 6.3 How JMP Interprets Two-Digit Years<br />

Two-Digit<br />

Year Value<br />

When it is Evaluated Result Examples Result<br />

00–10 before 1990 (on Windows) 19__ enter 5 in year 1979 1905<br />

before or during 1990 (on<br />

Macintosh)<br />

during or after 1990 (on<br />

Windows)<br />

20__ enter 5 in year 1991 2005<br />

after 1990 (on Macintosh)<br />

11–89 (on<br />

Windows)<br />

11–90 (on<br />

Macintosh)<br />

90–99 (on<br />

Windows)<br />

91–99 (on<br />

Macintosh)<br />

any time current century enter 13 in year 1988 1913<br />

enter 13 in year 2024 2013<br />

before 2011 19__ enter 99 in year 1999 1999<br />

during or after 2011 20__ enter 99 in year 2015 2099<br />

Note: JMP always displays four-digit years regardless of the regional settings. If you need to show two-digit<br />

years, use character string functions. See the “Types of Data” chapter on page 103.<br />

Date-Time Values in Data Tables<br />

Change Date-Time Input and Display Formats<br />

In data tables, JMP can accept the input of date-time values in one format (the input format), store them<br />

internally as the number of seconds since the base date, and display them in a different date-time format.<br />

The Informat() and Format() functions give you this control.<br />

• In Format() takes a string date-time value, defines the date format used in that string, and returns the<br />

date in ddMonyyyy format.<br />

Informat("19May2011 11:37:52 AM","ddMonyyyy h:m:s");<br />

19May2011:11:37:52<br />

• Format() takes the number of seconds since the base date (or a date-time function that returns that<br />

number) and returns the date in the specified format.<br />

Format(3388649872,"ddMonyyyy h:m:s");<br />

"19May2011 11:37:52 AM"<br />

Format(Today(),"ddMonyyyy h:m:s");

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

Saved successfully!

Ooh no, something went wrong!