BookmarkSubscribeRSS Feed
bhca60
Quartz | Level 8

How would I create a new date - i've tried a put statement, input to format it but nothing works:

proc sql;
create table example
as select
id,
(edate, yymmdd10.) as edate2
from table
quit;

ERROR 22-322: Syntax error, expecting one of the following: (, ).  

ERROR 76-322: Syntax error, statement will be ignored.

30       ! (edate, yymmdd10.) as edate2
                                _
                                22
ERROR 22-322: Syntax error, expecting one of the following: a name, *.  
3 REPLIES 3
andreas_lds
Jade | Level 19

Do you know how sas handles dates?

Please post some information about the variable edate: type, length?

bhca60
Quartz | Level 8
CHAR $10.
Kurt_Bremser
Super User

If edate is a character variable containing date strings, do the conversion to a SAS date like this:

input(edate, yymmdd10.) format=yymmdd10. as edate2

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 826 views
  • 1 like
  • 3 in conversation