BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aexor
Lapis Lazuli | Level 10

How to connect to DB is SAS?

 Can we use SAS function while connecting to DB?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

You cannot use SAS functions in the remote database.  As to whether SAS can transform statements that use those two or other SAS functions into the remote database it depends on what products you have licensed from SAS and how you are using them.  SAS/Access does have a way to translate many functions.  I think there is actually a metadata table somewhere with which functions SAS knows how to translate.  And for SAS/Access to Teradata there is (or at least used to be) a way to push the PUT() and INPUT() functions and format/informat definitions into Teradata.

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

@Aexor wrote:

How to connect to DB is SAS?

 Can we use SAS function while connecting to DB?


If you have one of the SAS/Access modules licensed.  You can either define a libref or use the CONNECT statement in PROC SQL.  SAS works fine when connected to an external database.  But if you are using implicit access to query the remote database then if SAS cannot figure our how to translate your code into syntax for the remote database then SAS will pull the data over to SAS and then apply the function.  If you use PROC SQL to issue commands directly in the remote database then you will need to use the syntax of that remote database in those statements.

Aexor
Lapis Lazuli | Level 10
Can we use PUT, INPUT or any other SAS functions while connecting to DB ?
Tom
Super User Tom
Super User

You cannot use SAS functions in the remote database.  As to whether SAS can transform statements that use those two or other SAS functions into the remote database it depends on what products you have licensed from SAS and how you are using them.  SAS/Access does have a way to translate many functions.  I think there is actually a metadata table somewhere with which functions SAS knows how to translate.  And for SAS/Access to Teradata there is (or at least used to be) a way to push the PUT() and INPUT() functions and format/informat definitions into Teradata.

Aexor
Lapis Lazuli | Level 10
Thank you!!

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1231 views
  • 2 likes
  • 2 in conversation