Results 1 to 5 of 5
  1. #1
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184

    Question SAS(Statistical Analysis System) to SQL

    Morning,

    Not sure if this is at all possible, however i shall explain:

    Our SAS programmer has decided to leave, and joy of joys i get to pick up where he left off. However, i don't use SAS and would rather use SQL (as its what i know best).

    Question: Is there a programmatical way to convert SAS code into SQL code?
    I can get definitions for SAS, but going through 1000's of lines of code and changing it to SQL by hand is going to take longer than i have.

    Example:
    SAS code:
    Code:
    procsql;
    createtable cartesian_case_controls
    asselect a.pracid, a.patid, a.dob, a.sex, a.index_date,
    b.control_matchid, b.control_patid, b.control_sex, b.control_dob, b.control_regdate, b.control_xferdate, b.control_regstat
    from case_population as a, potential_control_population1 as b
    where a.pracid = b.control_matchid and a.sex = b.control_sex and 0 le abs(a.dob - b.control_dob) le 1096 and
    b.control_regdate le a.index_date - 180 and b.control_regdate ne .and(b.control_xferdate ge a.index_date or b.control_xferdate eq .);
    quit;
    
    What it is when converted:

    Code:
    select a.pracid, a.patid, a.dob, a.sex, a.index_date, b.control_matchid, b.control_patid,
    b.control_sex, b.control_dob, b.control_regdate, b.control_xferdate, b.control_regstat
    from case_population as a, potential_control_population1 as b
    where a.pracid = b.control_matchid and a.sex = b.control_sex and 0 <=abs(a.dob - b.control_dob)andabs(a.dob - b.control_dob)<= 1096
    and b.control_regdate <=(a.index_date -180)and b.control_regdate isnotnull
    and(b.control_xferdate >= a.index_date or b.control_xferdate isnull)
    INSERTINTO cartesian_case_controls;
    

    Note: Not all of the SAS code is 'Proc SQL' which makes it alot more difficult.

    If anyone has some insite, just an idea of what might work (As i've never done conversions such as this). Or if anyone has come across the problem before, and has an idea of how they overcame this (even if it is just to start from scratch!)
    I can give more information if needed, but i think that it's all above.


    Many thanks in advance.




    Rixxe

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    not sure, but try: http://www.google.com/#hl=en&expIds=...0e24f52196c535

    also, maybe check out an SAS forum?

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I've never heard of any converting tools.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by weekend00 View Post
    I've never heard of any converting tools.
    the best tool is google if the on-hand count is 0.

  5. #5
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    Thanks for the replys.

    I have indeed tried google, i found the meanings of a large number of SAS terms, however this doesn't really solve the problem.
    As far as im aware, the only way to convert SAS to SQL, would be to pay someone stupendous amounts of money. (Which i'm not prepared to do!)

    If you don't mind, ill leave this thread open for a bit to see if anyone else might have an idea.

    Thanks for your time.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. ATM Cash Management System
    By NexusMike in forum Access
    Replies: 1
    Last Post: 08-09-2010, 12:48 AM
  2. vba code for regression analysis P value output
    By Frangipani in forum Programming
    Replies: 0
    Last Post: 02-04-2009, 06:26 AM
  3. System.mdb or System.mdw?
    By cgriella in forum Access
    Replies: 1
    Last Post: 09-30-2008, 08:16 AM
  4. Need Help with Queries-Trade Analysis
    By nybanshee in forum Queries
    Replies: 0
    Last Post: 03-08-2008, 11:50 PM
  5. Basic Quoting System
    By Travstar in forum Access
    Replies: 2
    Last Post: 12-12-2005, 09:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums