Hi All, I want to use no print option when data size is large .Please help me on the below.
Below is my sample code, if my data output exceeds 1000 observation then it should not print the output.
data xyz;
set sashelp.class;
run;
proc print data=xyz;
run;
proc report data=xyz (option=noprint);
run;
proc sql ;
select * from sashelp.class;
run;
Thanks,
Siva
I don't understand the request.
Do you want to only print a few observations to provide an example?
proc print data=xyz(obs=10);
title2 'First 10 observations';
run;
I don't understand the request.
Do you want to only print a few observations to provide an example?
proc print data=xyz(obs=10);
title2 'First 10 observations';
run;
Thanks for answer Tom.
Thanks for the replay Reeza.
if My data exceeds 1000 then it shout not print otherwise it should print .
your code is working fine.Thanks for the answer Reeza
1. Get the number of observations in the data set.
2. Decide to print or not.
proc sql noprint;
create table xyz as
select * from sashelp.class;
quit;
*gets count;
%let count = &sqlobs;
data _null_;
if &count <= 1000 then do;
call execute('proc print data=xyz; run;');
end;
run;
There are various ways to get the count and various ways to conditionally run things, I've illustrated one above. I'm assuming your code is not realistic and simplified for the forum so just giving the generic solution.
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.