proc sql;
create table order (oder_ID num(1),ProductName varchar2(25), OrderDate num format=yymmdd10.;
insert into order values(1,'Geitost','2008-11-11'd);
insert into order values(2,'Camembert Pierrot','2008-11-09'd);
insert into order values(3,'Mozzarella di Goviovanni','2008-11-11'd);
insert into order values(4,'Mascarpone Fabioli','2008-10-29'D);
quit;date format
In the CREATE TABLE statement, there is a missing parenthesis and a mispelling.
In the INSERT INTO statement, you must use a 'date' format to specify date values (such as date9.: DDMONYYYY)
orderdate num format=date9.
not working
That's not what I said -> you need to specify values as '11NOV2008'd and not '2008-11-11'd
The below query is the correction:
You should start to actually read our answers to your "questions". You have been shown how to supply date literals (in SQL, on top) at least once, like here: https://communities.sas.com/t5/SAS-Programming/proc-sql-column-date-datatype/td-p/594431
And why are you abusing SQL for a simple creation of a dataset, that's much easier done in a data step with datalines.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.