By stopping before you output and if you want before you read any obs. Use the STOP statement.
data likeshoes;
stop;
set sashelp.shoes;
run;
Log:
NOTE: The data set WORK.LIKESHOES has 0 observations and 7 variables.
Other methods - use OBS=0 on the SET statement, or PROC SQL with the LIKE statement.
data likeshoes;
set sashelp.shoes (obs=0);
run;
proc sql;
create table test like sashelp.shoes;
quit;
By stopping before you output and if you want before you read any obs. Use the STOP statement.
data likeshoes;
stop;
set sashelp.shoes;
run;
Log:
NOTE: The data set WORK.LIKESHOES has 0 observations and 7 variables.
Other methods - use OBS=0 on the SET statement, or PROC SQL with the LIKE statement.
data likeshoes;
set sashelp.shoes (obs=0);
run;
proc sql;
create table test like sashelp.shoes;
quit;
Datastep:
Method1:
data data2;
set sashelp.class(obs=0);
run;
proc print data=data2;
run;
Method2:
data data3;
stop;
set sashelp.class;
run;
SQL :
proc sql;
create table data4 like sashelp.class;
quit;
To create a zero observation dataset with column specifications:
DATA work.MEMBER;
LENGTH NAME $ 28 DOB 4;
FORMAT DOB DATE9.;
INFORMAT DOB DATE9.;
STOP;
RUN;
It is same like Create Table doing PROC SQL.
proc sql;
create table work.member
(Name varchar(28) ,
DOB num format date9.
);
quit;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.