Hi,
I tried once to PRINT select query in PROC PRINT, its worked for one time. But after the session turned off, I am unable to PRINT.
Below is the sample query.
PROC PRINT;
PROC SQL;
SELECT a,b,c FROM XYZ;
QUIT;
RUN;
Many thanks in advance.
By what do you mean "print" the query? Just putting the select will output the results directly to the output window if running interactive SAS unless you have turned that option off with:
ods noresults;
You can turn it back on with:
ods results;
If you mean you want to keep the data as a file then its a simple two step process:
extract data to a dataset then print the dataset:
proc sql; create table WANT as select A, B, C from HAVE; quit; ods rtf file="c:\results.rtf"; proc report data=want; columns _all_; run; ods rtf close;
Its very dependant on what you are doing/want which is not clear from your post.
And how do you want to display them, via file, output window? Have you tried the ods results? What about ods listing. What software are you using, is is interactive SAS or Batch.
ods listing; proc sql; select * from sashelp.cars; quit;
Then open the output window (not sure where its located as dont use EG, probably off the menu bar at the top, something like show output window).
After you run the code, does your EG process flow look something like this?
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.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.