BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ronein
Meteorite | Level 14

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
AMSAS
SAS Super FREQ

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

 

 

View solution in original post

4 REPLIES 4
gamotte
Rhodochrosite | Level 12

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.;
PeterClemmensen
Tourmaline | Level 20

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

 

http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/viewer.htm#a001360983.htm#a00...

 

 

Onizuka
Pyrite | Level 9

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.

AMSAS
SAS Super FREQ

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

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 44226 views
  • 5 likes
  • 5 in conversation