If you get the following error in SAS:
ERROR: Expression using greater than (>) has components that are of different data types
you may be trying to evaluate dates. The following SAS PROC SQL code would generate those errors.
PROC SQL;
CREATE TABLE LIBRARY_NAME.EXAMPLE_TABLE AS
(
SELECT * FROM LIB_NAME.SRC_TABLE
WHERE PRODUCT_DATE GT ’12DEC2008′
);
QUIT;
The problem lies in the way I formatted the date. If you are calling from a database and the date formats that the database holds do not work (e.g. 12/12/2008 or 2008-12-12, etc . . .) then you can use the SAS date format. The SAS date format is DDMMMYYYY where MMM are the first three letters of the month. You enclose this in single quotes and follow it by the letter d. See the example below.
PROC SQL;
CREATE TABLE LIBRARY_NAME.EXAMPLE_TABLE AS
(
SELECT * FROM LIB_NAME.SRC_TABLE
WHERE PRODUCT_DATE GT ’12DEC2008′d
);
QUIT;
This will allow you to execute your statement.
