Desktop productivity for business analysts and programmers

how to create a table with proc sql and setting a variable to a default value

Reply
Regular Contributor
Posts: 170

how to create a table with proc sql and setting a variable to a default value

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;

 

Super User
Posts: 5,920

Re: how to create a table with proc sql and setting a variable to a default value

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
Regular Contributor
Posts: 170

Re: how to create a table with proc sql and setting a variable to a default value

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

Thanks

Ask a Question
Discussion stats
  • 2 replies
  • 63 views
  • 0 likes
  • 2 in conversation