Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    2

    Question Unanswered: Pass-through to SAS

    Is it possible from sql to use SAS as an object? And if so how?

    I was recently tasked with Data Profiling and sitting next to me is a SAS developer, who just has to run a couple of functions, to do what has taken me days (and I haven't finished!). If I could call out to SAS and run the SAS functions it would be great. I have looked on the net and can see SAS calling out to SQL but not the other way round. Technically I'm probably not up to this but I don't want this to hold me back... so any help would be great.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    It probably is possible, and the method depends on exactly what you want to do. I'm sorry I can't be more specific, but without more to go on that is the best I can do.

    If you have the ODBC driver for SAS, that would help a lot. If not, but you can execute master.dbo.xp_cmdshell and put the SAS client on the server, that might help too.

    -PatP

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Uhmmm, what are you trying to do? Maybe there is a faster method that you are not aware of...
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Nov 2004
    Posts
    2

    Unhappy

    Sorry for the delay I've been away.....

    I'm going to leave the communication to SAS from SQL for now, but I had a look at another thread 'Cursor or temp table' which seemed appropriate, I'm well aware coming from Foxpro to SQL I have a lot to learn.

    I was tasked with data profiling on our warehouse and so set to writing some generic functions to gather some basic statistics on the dml layer. (Looked at what SAS could provide and it was just over the top)

    1. How many nulls
    2. Frequency on values
    3. Min & Max values

    I gathered the database info from information_schema, added an extra column to tag the tables and columns I was interested in and then used this to run the MAX(), MIN() and COUNT(*) functions and then stored the results to a table.

    My questions are: I'm I missing something, could I have done this without a cursor? 2) Would it have been faster and better to create a temp table and then skipped thru that? 3) I couldn't have done all this in a select could I?

  5. #5
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Yeah, you could probably do it all in a SELECT, unless there are some odd complications you not telling us about.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •