Any trailing blanks or leading blanks included within the quotation marks do not affect
the processing of the date constant, time constant, or datetime constant.
Use the following patterns to create date and time constants:
'ddmmm<yy>yy'D or “ddmmm<yy>yy”D represents a SAS date value:
• date='1jan2013'd;
• date='01jan09'd;
'hh:mm<:ss.s>'T or “hh:mm<:ss.s>”T represents a SAS time value:
• time='9:25't;
• time='9:25:19pm't;
'ddmmm<yy>yy:hh:mm<:ss.s>'DT or “ddmmm<yy>yy:hh:mm<:ss.s>”DT represents a
SAS datetime value:
• if begin='01may12:9:30:00'dt then
end='31dec13:5:00:00'dt;
• dtime='18jan2003:9:27:05am'dt;
'yyyy-mm-ddThh:mm:ssZ'DT or 'yyyy-mm-ddThh:mm:ss+|-hh:ss'DT represent a SAS
datetime constant for Universal Coordinate Time (UTC) based on the ISO 8601
standard.
• tstamp='2013-05-17T09:15:30–05:00'dt; and
tstamp='2013-05-17T09:15:30–05'dt; specifies the UTC for Eastern
Standard Time.
• tstamp='2013-07-20T12:00:00+00:00'dt; and
tstamp='2013-07-20T12:00:00Z'dt; specifies the UTC for the zero
meridian near Greenwich, England.
For more information about SAS dates, see Chapter 7, “Dates, Times, and Intervals,” on
page 111.
Bit Testing Constants
Bit masks are used in bit testing to compare internal bits in a value's representation. You
can perform bit testing on both character and numeric variables. The general form of the
operation is:
expression comparison-operator bit-mask
The following are the components of the bit-testing operation:
expression
can be any valid SAS expression. Both character and numeric variables can be bit
tested. When SAS tests a character value, it aligns the left-most bit of the mask with
the left-most bit of the string; the test proceeds through the corresponding bits,
moving to the right. When SAS tests a numeric value, the value is truncated from a
floating-point number to a 32-bit integer. The right-most bit of the mask is aligned
with the right-most bit of the number, and the test proceeds through the
corresponding bits, moving to the left.
comparison-operator
compares an expression with the bit mask. See “Comparison Operators” on page
101for a discussion of these operators.
bit-mask
is a string of 0s, 1s, and periods in quotation marks that is immediately followed by a
B. Zeros test whether the bit is off; ones test whether the bit is on; and periods ignore
96 Chapter 6 • Expressions