BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

Hello,

 

May I ask what file I need to modify to add LOGPARM= option?

 

Thanks

4 REPLIES 4
ballardw
Super User

Logparm is going to need to be configured in the config file or command line option.

 

If you are looking for a way to create output of the log you may want to investigate Proc Printto. With the LOG= option to direct the log output to a text file it is pretty flexible and can be turned off and on for specific procedures or data steps.

 

A rough example:

proc printto log='d:\log.txt' new;
run;

proc freq data=sashelp.class;
   tables sex;
run;

proc means data=sashelp.class;
   var height weight;
run;

proc printto;   /* without options ends proc printto output*/
run;

the path to the text file should of course be valid on your system.

 

The options of printto actually let you append to an existing file so you could be creating separate streams of log output, such as one for data steps, one for analyis procedures and yet another for report procedures.

GeorgeSAS
Lapis Lazuli | Level 10

Thank you very much!

 

May I ask how to do it in config file or command line option?

 

Thanks!

ballardw
Super User

First you need to know what you want to accomplish with the values you set.

If you want to make the same settings for every session then edid the config file.

Then find the config file you are using. Copy and make a backup of the current working version just in case.

It will be a text file with a name like SASV9.CFG

You would add a some code that looks like

-LOGPARM=  "<OPEN= APPEND | REPLACE | REPLACEOLD>  
 <ROLLOVER= AUTO | NONE | SESSION | n | nK | nM | nG>  
 <WRITE= BUFFERED | IMMEDIATE>" 

with one or more of the options set for  Open Rollover Write. Without knowing exactly what you are attempting to do it is hard to make suggestions and I refer you to online help.

 

 

If you want to change for different sessions then in what every program or tool starts SAS you would add -logparm "  <options go here>" note that you may want to work with the -LOG as well as there are directives that affect the name of the log file(s) created.

PhilC
Rhodochrosite | Level 12

I just added this line to my config file and it worked to answer my own problem. 

 

-LOGPARM "WRITE=IMMEDIATE"

The syntax of how to convert a command line parameter to a config file entry was something I was wondering about.  This article helped me.  @ballardw put an equal sign, I didn't use one.  It might be optional.  The angle brackets I figure were used to indicate the three sub-options are optional and not required in the quotes.  Thanks

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
  • 4 replies
  • 1533 views
  • 2 likes
  • 3 in conversation