How to check Databse is available to extract the data in SAS

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 81
Accepted Solution

How to check Databse is available to extract the data in SAS

Hi SAS users,

 

I wanted some ideas, on how to code to check if the Databse is avaialble to extract the data from Tables into SAS datasets.

 

In my project I am pulling multiple sources data (DB2, Oracle, My SQL) and creating some sas datasets.

 

As the pull is from external Databases, I want to make sure the Databse is available, if not  -  I have to generate Email to the Team saying that these Databases are not avaiable, try after some time  Message ,  as this process is going to be in scheduled automation.

 

Please suggest ideas.

 

Thanks,

Ana


Accepted Solutions
Solution
‎12-12-2016 10:23 PM
Respected Advisor
Posts: 3,062

Re: How to check Databse is available to extract the data in SAS

[ Edited ]

Database and server availability is normally monitored by IT Support with tools designed for the task. I'm curious to know why you think you need to do it too.

 

On the other hand, if this is more about whether the data you need has been loaded or not I can understand why you would want to check this. I find that running a simple row count query for the required data is a good check of whether the data is loaded or not. If it is not yet loaded you can get your program to wait a specified time and then try again.

View solution in original post


All Replies
Super User
Posts: 1,228

Re: How to check Databse is available to extract the data in SAS

Few notes:

1) You should ask the DBA of each database, is there a utility to check avilibility.
     

2) In case the sas job is running under scheduler, maybe there is a "source" code/condition

    that may tell you when database is available

 

3) You can create couples of jobs: the first tries to read from a database and

     if it fails the second one - dependent on the first return code - sends the email.

Solution
‎12-12-2016 10:23 PM
Respected Advisor
Posts: 3,062

Re: How to check Databse is available to extract the data in SAS

[ Edited ]

Database and server availability is normally monitored by IT Support with tools designed for the task. I'm curious to know why you think you need to do it too.

 

On the other hand, if this is more about whether the data you need has been loaded or not I can understand why you would want to check this. I find that running a simple row count query for the required data is a good check of whether the data is loaded or not. If it is not yet loaded you can get your program to wait a specified time and then try again.

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 160 views
  • 0 likes
  • 3 in conversation