BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

Hello,

 

I am using SAS EG 7.11 and I would like to create a table  and setting some variables to a default value as below

Except this code is not working.

 

Does someone has already work on that issue.

Regards,

 

 

proc sql;

create table table1 (field1 num,

field2 num default 5557,

field3 num default 1337,

 

 

 

field4 date default today());

quit;

 

2 REPLIES 2
LinusH
Tourmaline | Level 20

SAS doesn't support default constraints (unfortunately).

If you have access to a SQL Server database you can use SQL pass through to specify these.

Data never sleeps
alepage
Barite | Level 11

Could you please provide me an example how set default value using SQL pass through facility?

Thanks

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 535 views
  • 0 likes
  • 2 in conversation