Hello
When do we add noprint option to proc sql?
What is the difference between proc sql without noprint option and proc sql with noprint option
For example:
proc sql noprint;
create table bbb as
select *
from sashelp.cars
where origin='Asia'
;
quit;
proc sql ;
create table ccc as
select *
from sashelp.cars
where origin='Asia'
;
quit;
Editors note:
Both responses from @PeterClemmensen and @Onizuka are correct
For full details see PRINT | NOPRINT Documentation and Using the PROC SQL Automatic Macro Variables
Hello,
Try with this query instead to see the difference :
proc sql ;
select distinct make
into :make_lst separated by ','
from sashelp.cars
where origin='Asia'
;
quit;
%put &make_lst.;
The NOPRINT Option also affects the automatic macro variable SQLOBS. See the code below
proc sql noprint;
select * from sashelp.class;
quit;
%put &SQLOBS.;
proc sql;
select * from sashelp.class;
quit;
%put &SQLOBS.;
And read more here
When you use the "noprint" option, it simply means that you are not going to have a display output on your screen. It can be used when you are creating macro-variables. For example :
Proc sql /* noprint */ ;
select name into: list /* this create a macro variable "list" which contain all valus of var name */
from example;
quit ;
So when you do this, you may don't want to see the output so you put the option noprint.
Editors note:
Both responses from @PeterClemmensen and @Onizuka are correct
For full details see PRINT | NOPRINT Documentation and Using the PROC SQL Automatic Macro Variables
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.