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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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