Hi ,
Just wanted to check what extra step I need to add to select 10 records from table1
PROC SQL;
CONNECT TO odbc as test
(PATH=ksts userid=ksdetail password=&hh);
CREATE TABLE MyTable AS
SELECT *
FROM CONNECTION TO test (
SELECT
t1.ID
FROM Table1 t1
);
DISCONNECT FROM test;
QUIT;
Can anyone help
Thanks
Using your program this is the easiest way, not necessarily the most efficient:
PROC SQL;
CONNECT TO odbc as test
(PATH=ksts userid=ksdetail password=&hh);
CREATE TABLE MyTable (obs= 10) AS
SELECT *
FROM CONNECTION TO test (
SELECT
t1.ID
FROM Table1 t1
);
DISCONNECT FROM test;
QUIT;
The only TABLE1 in that query is in a remote database.
So you need to know what syntax that database allows for limiting the number of observations returned by a query.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.