BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lmtamina
Obsidian | Level 7

Hi,

I would like to ask for assistance regarding SQL Pass-Through facility in SAS EG. I have  never used this function in the past, and would like to inquire on how to retrieve the query results and be able to save as SAS dataset so I can use in data step task. I was able to successfully connect to our DBMS using the sample proc sql statement I created below, however, when I tried to create a SAS dataset from the query results , i am getting an error ,saying that the table I created from the pass -through query is not found. Appreciate any assistance. Thank you in advance.

 

proc sql;

connect to Oracle as mydata(path= path connection = global connection_group ="Con_Group" user = 'myuser' password='mypass');

create table Query_Results as

select * from Connection to mydata

(select *

 from Oracle_MBR_Table

where mbr_group_id ='12345';

disconnect from mydata;

quit;

 

data want;

set Query_Results;

run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

You may want to show us code that actually runs.  The PROC SQL has unmatched parentheses [The "(" before "select" does not have a matching ")".]

View solution in original post

2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12

You may want to show us code that actually runs.  The PROC SQL has unmatched parentheses [The "(" before "select" does not have a matching ")".]

lmtamina
Obsidian | Level 7

My apologies .. and thank you so much. I was  so intimidated  by the SQL pass- through syntax  and overlooked the missing parenthesis . I can now  see the results.  Appreciate it!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3020 views
  • 1 like
  • 2 in conversation