BookmarkSubscribeRSS Feed
BaharH
Calcite | Level 5

Hi. In a sql data source, I want to extract a table with 4 columns with PROC SQL. But with a constrain. this constrain is a table (name: sleutel) with one column (name: sleutel2) which is stored in my laptop. This is my code. But it does not work. could you please help me?

 

data IA_data;
set work.sleutel;
run;

PROC SQL;
select ia.sleutel2
from IA_data ia;

CONNECT TO ODBC AS mycon (datasrc=IA_P);
select *
FROM CONNECTION TO mycon
(SELECT
column1,
column2,
column3,
column4

FROM ia_treinrit trr
where
column1 = ia.sleutel2
);
run;

DISCONNECT FROM mycon;
QUIT;
1 REPLY 1
andreas_lds
Jade | Level 19

But it does not work. could you please help me?

No, we can't help you because "does not work" can mean anything. We need to see the log at least, please post it using the "insert code" function, 7th button above the textbox.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 563 views
  • 0 likes
  • 2 in conversation