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.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.