BookmarkSubscribeRSS Feed
deleted_user
Not applicable
In the SAS documentation about log files, there is a section that provides special parameters/characters for log file names: like #A for the day of the week.

e.g. test_log.#A.#Y-#m-#d.#H.#M.#s.log

that should produce "test_log.Friday.2007-12-21.13.33.00.log"

Apparently this doesn't work for proc printto log="test_log..." ;
Is this true? or am I missing some option someplace?
I set -logparm "open=replace write=immediate rollover=session"
Am I SOL? or what?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I believe that -logparm is an invocation option and that it works with the -log option. So if you have:
[pre]
sas -log "test%H%M.log" -logparm "rollover=session"
[/pre]

Then it is the -log option that is naming the LOG file. So that means that you will find a SAS log file under the -LOG option name -- using whatever directives you used in the option.

It would not be appropriate to then use PROC PRINTTO to redirect the LOG to a different name, because you would be redirecting it away from the name that the
-LOG option.

According to the doc for PROC PRINTTO, it says that:
PROC PRINTTO LOG=file-specification;
This procedure statement sends any following SAS log entries to the disk file associated with file-specification during a SAS session. The value for file-specification can be any valid external file specification discussed in Identifying External Files to SAS.


And if you look in the section referenced, there is no mention there of using directives to name the external file. It looks like the special directives (that start with % or #) are only allowed in the -LOG option.

You can check with Tech Support for more help on your logging issue. Perhaps if you explain to them the conditions under which you want to change the log name and which servers/operating systems are involved, they can help you further.

cynthia
deleted_user
Not applicable
I'm not entirely clear on the correspondent's specific needs, but if you want to create a date time stamped PrintTo log, then you run a procedure within the SAS session. It seems to me that you then have the power of the data step and the macro language to calculate the unique naming for the log file and have no need for the system level mnemonics.

Where I have a SAS session with a handful of included programs and I have a need for a session log containing all log data, and an individual program log for each program, I define an alternate log with the invocation option "-altlog" and then call the PrintTo procedure with names specific to the included program.

If you're running this under Enterprise Guide though, your project will already contain a complete set of step logs for the nodes you execute.

Kind regards

David

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 653 views
  • 0 likes
  • 2 in conversation