BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

How can I clear the log and output so that I do not stay by my pc ;


ods listing close;

macro surv(iterations=);

%do p=1 %to &iterations;

data test_&p;

seed = -1;
alpha1 =
2.50;
beta1 =
9.50;
do i =
1 to 100 
lambdaT =
0.082; *baseline hazard; 
lambdaC=
0.400001;

      er=0.00+sqrt(0.00001)*rannor(0); *error dist
N(0.00,0.00001);

 
t = rand(
"WEIBULL", 1, lambdaT); * time of event;

  
c = rand(
"WEIBULL", 1, lambdaC) ;* time of censoring;

  
time = min(t, c);   
* which came
first?
 
censored = (c lt t);

      obs=(t lt c); * creating
observation variable from censored when observeed obs=1;

      y= alpha1+beta1*t+ er; 
output;

end;

run;

proc sort data=test_&p;

by time;

run;

proc means data = test_&p sum;

     where obs = 0;

    var censored;  

ods output summary = summary_&p;

run;

data cenN;

set summary_1-summary_&p;

run;

/***** MI*******/

proc freq data=test_&p ;

table censored;

ods output OneWayFreqs= cen_&p;

run;

data censored;

set cen_1-cen_&p;

run;

%end;

%mend surv;

%surv(iterations=1000);

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

the program statement:

dm 'log;clear;output;clear;';

will clear those.

If you need the ODS Results cleared as well add

odsresults;select all;clear;

within the single quotes or use another DM statement

View solution in original post

8 REPLIES 8
Reeza
Super User

Look into proc printo - redirects the log to a file

Options nonotes - supresses notes to the logs, except warnings and error messages

ODS listing close; - you're already using Smiley Happy

ods noresults

Peter_C
Rhodochrosite | Level 12

alternatively, run the program in batch

create an icon with the regular sas.exe in the comand line along with the program name, like

".......relevant...path"\sas.exe  -sysin "your program.sas"

ensuring the "Start in" folder points to the folder of your program

then just double-click the icon

It should not need the -config option defined

sorry, forgot to refer to the program on the command line

ballardw
Super User

the program statement:

dm 'log;clear;output;clear;';

will clear those.

If you need the ODS Results cleared as well add

odsresults;select all;clear;

within the single quotes or use another DM statement

Jagadishkatam
Amethyst | Level 16

Another way of writing the dm code is as below

dm 'clear log';

dm 'clear output';

Thanks,

Jagadish

Thanks,
Jag
SuneelReddy
Fluorite | Level 6

Hi,

Please use the below before writing the code

"dm 'log;clear;output;clear';" it will clear the log and output as well once you executed the program.

REgards

Suneel Reddy

desireatem
Pyrite | Level 9

Ladies and Gentlemen, Thanks, now I know many ways to clear both the log and output files

Reeza
Super User

You can mark this question (and others) as answered as well.

kaji
Fluorite | Level 6

Hi,

 

I found a pretty cool add-in to Base SAS on www.tatesoft.com that may be very usefull to you. The tool called Log Analyser is integrated into Base SAS and can produce Log summary report in a second. You may also analyse log in details if you wish. Really great tool!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 8 replies
  • 64553 views
  • 9 likes
  • 7 in conversation