Hi, Fairly new to using SAS and did some training the other day where the trainer discussed a pass through query. Did get much chance to go into detail about it as I was the only one who would likely be using it so I have a couple of questions and wuld appreciate it if someone could just say yes or no to them. The indication I got about a pass through was that it would be possible for me to write native SQL and send that off the server where it would be processed and then returned as SAS dataset which could be manipulated. Is this correct? If so, does that mean I can use the full range of syntax available in SQL? An example is row_number which we use a lot. I've posted a completely made up example of the query below which return the latest code and name for an ID based on when the update. select ID, CODE, NAME from ( select ID, CODE, NAME, row_number () over (partition by ID order by CHANGEDATE desc) as ranking from ID_Index) as data where ranking = 1 Could I send this and have returned as a dataset? And, the big question, how would I do this. The best I can find from websearching is: Proc sql; Connect to odbc(datasrc=”CRDM2” user=uid password=pwd); (Where this is the database I'm connecting to I assume) Create table work.latestID as Select * from connection to odbc ( select ID, CODE, NAME from ( select ID, CODE, NAME, row_number () over (partition by ID order by CHANGEDATE desc) as ranking from ID_Index) as data where ranking = 1); Disconnect from odbc; Quit; Is this correct? Sorry but I'm so new to this that if I can get this right it should save a bunch of follow up questions. Thanks
... View more