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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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