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

 

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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