BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
akramaiya
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

View solution in original post

6 REPLIES 6
mohamed_zaki
Barite | Level 11

Where is the problem? Share your code please. Or check : Inserting Rows into Tables

akramaiya
Calcite | Level 5

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 ;

ballardw
Super User

What library is your FEVDATA dataset in?

End Proc SQL with QUIT; not RUN:

akramaiya
Calcite | Level 5

FEVdata is in the work library.

ballardw
Super User

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.

akramaiya
Calcite | Level 5

Thank you very much! Smiley Happy It worked

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to connect to databases in SAS Viya

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.

Discussion stats
  • 6 replies
  • 3116 views
  • 1 like
  • 3 in conversation