I am posting a (hopefully correct) response for "How to select first few records to test the Proc SQL", which has a non-working solution, and is locked:
@LAP @srinidelite @SimonJF @ChrisNZ @Reeza @LinusH the solution I came up with is:
Proc Sql outobs=10;
create table TESTRESULT as
select COL1, COL2
from YOURLIB.YOURTABLE
where YOURFILTERS;
quit;
If there is no error in the SQL statement, this will return 10 records and produce &syscc = 4 / &sqlrc = 4 (warning.)
You need to code to check SYSCC/SQLRC, if you are checking for warnings or errors.
Using option OUTOBS= is the chosen solution. As I see it, this post brings no value to a topic closed 12 years ago.
> Unclear where OUTOBS= is supposed to go.
Really?
Here is first line of the chosen reply:
you can use inobs= or outobs= option on the PROC SQL statement.
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 save with the early bird rate—just $795!
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.