DATA Step, Macro, Functions and more

how to push sas Data set into SQL server

Accepted Solution Solved
Reply
Contributor
Posts: 61
Accepted Solution

how to push sas Data set into SQL server

[ Edited ]

how to push sas Data set in to SQL server(RTest- SQl R)


Accepted Solutions
Solution
‎03-10-2017 04:06 AM
Trusted Advisor
Posts: 1,326

Re: how to push sas Data set into SQL server

Posted in reply to sivastat08

Hello @sivastat08,

 

while I cannot understand the remark of "RTest- SQl R". to move data from a SAS dataset to any other data origin, such as SQL server you will need:

 

- the license for SAS/ACCESS interface to (your data source) (SQL Server, or ODBC. You can get also OLEDB, but I would rather advise against it, unless you have a very specific requirement).

- to install that SAS software component

- to install and configure the drivers for the SQL Server on the client and the server (if required)

- you use the appropiate libname statement in your code 

- use a data step or proc sql, as with any other table

View solution in original post


All Replies
Super User
Posts: 5,441

Re: how to push sas Data set into SQL server

Posted in reply to sivastat08

There are literally thousands of examples online, start with SAS/ACCESSS documentation.

Data never sleeps
Contributor
Posts: 61

Re: how to push sas Data set into SQL server

thanks LinusH.
Solution
‎03-10-2017 04:06 AM
Trusted Advisor
Posts: 1,326

Re: how to push sas Data set into SQL server

Posted in reply to sivastat08

Hello @sivastat08,

 

while I cannot understand the remark of "RTest- SQl R". to move data from a SAS dataset to any other data origin, such as SQL server you will need:

 

- the license for SAS/ACCESS interface to (your data source) (SQL Server, or ODBC. You can get also OLEDB, but I would rather advise against it, unless you have a very specific requirement).

- to install that SAS software component

- to install and configure the drivers for the SQL Server on the client and the server (if required)

- you use the appropiate libname statement in your code 

- use a data step or proc sql, as with any other table

Contributor
Posts: 61

Re: how to push sas Data set into SQL server

Posted in reply to JuanS_OCS

actually im connecting R- software with SQL server(Library name is -RTest ) and i wnat to push the sas data set to SQL server

Super User
Posts: 7,866

Re: how to push sas Data set into SQL server

Posted in reply to sivastat08

-Rtest is not a valid SAS name.

Please specify how you access the R data from SAS and which libname statement you use for SQL Server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super Contributor
Posts: 340

Re: how to push sas Data set into SQL server

Posted in reply to sivastat08

You probably are supposed only to insert data (and not to create tables). Could be something like:

Proc SQL;
  Insert Into <SQL.Table> Select * From <SAS.Table>;
Quit;
☑ This topic is solved.

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

Discussion stats
  • 6 replies
  • 207 views
  • 3 likes
  • 5 in conversation