DATA Step, Macro, Functions and more

'No print' for proc sql

Reply
Regular Contributor
Posts: 154

'No print' for proc sql

Hi,

 

One quick question. If I write 'no print' after 'proc sql', will run time be reduced? 

 

For example: table1 is an intermediate table that I am not going to save in any folder, but will be used for later data procedures. 

 

Initially, 

Proc Sql;

       Create table table1 as select * from work.table 

       Where ...;

Quit;

 

Then,

Proc Sql noprint;

       Create table table1 as select * from work.table 

       Where ...;

Quit;

 

 

Thank you! 

Community Manager
Posts: 3,462

Re: 'No print' for proc sql

No, I don't think so.  NOPRINT affects SQL operations that don't create/update a data set.  In those cases, the result is sent to ODS output.

 

If you use CREATE TABLE, then NOPRINT is a "no op".

PROC Star
Posts: 275

Re: 'No print' for proc sql

The NOPRINT option in proc SQL is mostly used when doing a SELECT INTO, that is you use a query to create macro variables, e.g.

proc sql noprint;
  select distinct age into :ages separated by ',' 
  from sashelp.class;
quit;

In this case, you are doing a SELECT statement that does not create a table; that would normally produce a print. But you just want the ages listed in the macro variable AGES, so you use NOPRINT to bypass the print.

If no print would be generated anyway, then the NOPRINT option has no effect.

Super User
Posts: 10,574

Re: 'No print' for proc sql

Aside from the good answers you already got, what keeps you from using options fullstimer; and run a series of tests on your own?

 

See Maxim 4.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 3 replies
  • 2168 views
  • 0 likes
  • 4 in conversation