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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 lock in 2025 pricing—just $495!

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
  • 2 replies
  • 1184 views
  • 0 likes
  • 2 in conversation