DATA Step, Macro, Functions and more

Insert Data into Sql Table from SAS University Edition

Reply
Occasional Contributor
Posts: 9

Insert Data into Sql Table from SAS University Edition

Hi,

I am using SAS University Edition and am connecting to the SQL database using PCFiles as described in below link.

 

https://communities.sas.com/t5/SAS-Analytics-U/Connect-to-SQL-Server-Oracle-Database-by-SAS-Universi...

 

Now I want to push the data from SAS to SQL Table. Pl. suggest an appropriate way to achieve this.

 

 

Thanks in Advance.

 

 

Super User
Super User
Posts: 7,411

Re: Insert Data into Sql Table from SAS University Edition

So what have you done from that post, as it gives you the answer.  Create a libname to the database, then datastep set your new data with and existing one:

data <database_libname>.<database_table_name>;

  set <database_libname>.<database_table_name> <your_new_data>;

run;

Super User
Posts: 17,868

Re: Insert Data into Sql Table from SAS University Edition

It's not officially supported. 

Super User
Posts: 9,682

Re: Insert Data into Sql Table from SAS University Edition

 I don't know if it could work, I never test it before.

 

1) libnanme z .........  /* NO   access=readonly   option*/

 data SQL_lib.want;

  set SAS_lib.want;

 run;

 

OR

proc copy in=SAS_lib out=SQL_lib;

 select want;

run;

 

OR SQL

proc sql;

insert into SQL_lib.want 

 select * from SAS_lib.want;

quit;

 

 

2)PROC DBLOAD .

 

3)Pass-through 

proc sql;

connect to pcfiles();

execute( inset into ......... ) 

by pcfiles;

quit;

Ask a Question
Discussion stats
  • 3 replies
  • 199 views
  • 0 likes
  • 4 in conversation