Hello,
I need to add a row of data in my table. Could someone please tell me how i can do this? I tried proc sql but it didn't work.
Then
proc sql;
insert into work.fevdata
values (., 8, ., ., ., .);
quit;
or
proc sql;
insert into fevdata
values (., 8, ., ., ., .);
quit;
sql.fevdata was telling SAS to look for the dataset fevdata in the SQL library which you obviously did not have assigned. I suspect you copied some code from some examples where all the example data was in a library named SQL. Which could be a tad confusing working in Proc SQL.
Where is the problem? Share your code please. Or check : Inserting Rows into Tables
I followed that with the following code but got an error:
*Add row with just age*;
proc sql;
insert into sql.fevdata
values (., 8, ., ., ., .);
run;
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
42 ;
43 proc sql;
44 insert into sql.fevdata
45 values (., 8, ., ., ., .);
ERROR: Libref SQL is not assigned.
ERROR: Libref SQL is not assigned.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
46 run;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
47 ;
48 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
58 ;
What library is your FEVDATA dataset in?
End Proc SQL with QUIT; not RUN:
FEVdata is in the work library.
Then
proc sql;
insert into work.fevdata
values (., 8, ., ., ., .);
quit;
or
proc sql;
insert into fevdata
values (., 8, ., ., ., .);
quit;
sql.fevdata was telling SAS to look for the dataset fevdata in the SQL library which you obviously did not have assigned. I suspect you copied some code from some examples where all the example data was in a library named SQL. Which could be a tad confusing working in Proc SQL.
Thank you very much! It worked
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.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.