Hi everyone.
I'd like to insert columns from table A into a new table called ''new", but got errors: File work.new.date does not exist.
Could you please give me some suggestions?
Thanks in advance!
PROC SQL;
INSERT INTO new
SELECT variable1, variable2, variable3
FROM A;
QUIT;
@runrunbunny wrote:
Hi everyone.
I'd like to insert columns from table A into a new table called ''new", but got errors: File work.new.date does not exist.
Could you please give me some suggestions?
Thanks in advance!
PROC SQL;
INSERT INTO new
SELECT variable1, variable2, variable3
FROM A;
QUIT;
Try
PROC SQL; Create table new as SELECT variable1, variable2, variable3 FROM A; QUIT;
The insert as you attempted requires the data set to exist, Create table creates the new set
Sounds like you don't have a dataset named NEW yet. So instead of trying to append observations to an existing dataset you want to make a new dataset. In SQL you would use CREATE TABLE for that.
create table new as
select variable1, variable2, variable3
from a
;
Or in regular SAS code a simple data step.
data new;
set a;
keep variable1-variable3;
run;
@runrunbunny wrote:
Hi everyone.
I'd like to insert columns from table A into a new table called ''new", but got errors: File work.new.date does not exist.
Could you please give me some suggestions?
Thanks in advance!
PROC SQL;
INSERT INTO new
SELECT variable1, variable2, variable3
FROM A;
QUIT;
Try
PROC SQL; Create table new as SELECT variable1, variable2, variable3 FROM A; QUIT;
The insert as you attempted requires the data set to exist, Create table creates the new set
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.