SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How do you add a row with values?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

How do you add a row with values?

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.


Accepted Solutions
Solution
‎10-03-2014 05:49 PM
Super User
Posts: 11,343

Re: How do you add a row with values?

Posted in reply to akramaiya

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


All Replies
Super Contributor
Posts: 490

Re: How do you add a row with values?

Posted in reply to akramaiya

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

Occasional Contributor
Posts: 15

Re: How do you add a row with values?

Posted in reply to mohamed_zaki

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 ;

Super User
Posts: 11,343

Re: How do you add a row with values?

Posted in reply to akramaiya

What library is your FEVDATA dataset in?

End Proc SQL with QUIT; not RUN:

Occasional Contributor
Posts: 15

Re: How do you add a row with values?

FEVdata is in the work library.

Solution
‎10-03-2014 05:49 PM
Super User
Posts: 11,343

Re: How do you add a row with values?

Posted in reply to akramaiya

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.

Occasional Contributor
Posts: 15

Re: How do you add a row with values?

Thank you very much! Smiley Happy It worked

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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