Hpw do I do this??
Please someone help me
Table A1 : Conisit of 10 columns and there are 100 records
create a TABLE B1 from A1 where B1 should contain only the structure of A1 and no records should be copied.
Thank you
Well, Q1 - why, not really much point creating an emtpy copy of a dataset. But anyways, two options:
proc sql; create table WANT as select * from HAVE where 1=0; quit; data want; set have; if _n_ < 0 then output; run;
You could also generate it from metadata, but thats probably more code than the above.
Proc SQL;
create table b1
like a1;
quit;
Nice, I always forget the like command.
and one more:
data b1; set a1(obs=0); run;
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.