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

 

…..I cleared log and use proc printto to save log, but log start from line 4109? how to make it start from line 1?

don't know how to reset number after each run. thanks.

 

 

dm output 'clear';

dm log 'clear';

proc delete data=work._all_;

run;

proc printto log='L:\ acct.log' new;

run;

 

NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
     

4109 
4110 
4111  ****************************************************************************
4112  Filename

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

You can try using the RESETLINE statement.

https://documentation.sas.com/?docsetId=lestmtsglobal&docsetTarget=n12yrecjoxsozln1rgu8t4h4eo3k.htm&...

 

But note that you now be generating SAS logs that are lying to you about what has happened.  Reseting the line numbering does NOT change all of the other settings, datasets, filenames, libnames, etc that the pervious 4000 lines of code have generated.

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Clearing the log does not reset the line numbers to 1. So maybe you don't need the line numbers reset to 1.

 

If you want everything saved from line 1, you want to use PROC PRINTTO as the first line of your program — or use the ALTLOG option when you invoke SAS.

--
Paige Miller
magicdj
Obsidian | Level 7

I don't have any config file, and I searched online, find an example,

-altlog L:\acct.log   

this command is not working. don't know how to use it.

 

I put in fist line of my program. but before I run my program, I had to run some macro to setup path, call macro programs, that is the 4000 line before my program log. 

Reeza
Super User
You would add that line to your config file. Every SAS installation has a config file.
Tom
Super User Tom
Super User

You can try using the RESETLINE statement.

https://documentation.sas.com/?docsetId=lestmtsglobal&docsetTarget=n12yrecjoxsozln1rgu8t4h4eo3k.htm&...

 

But note that you now be generating SAS logs that are lying to you about what has happened.  Reseting the line numbering does NOT change all of the other settings, datasets, filenames, libnames, etc that the pervious 4000 lines of code have generated.

magicdj
Obsidian | Level 7

well, I believe altlog is what I looking for, but not sure how to use altlog.

so I will use resetline for now. thanks all.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 5 replies
  • 939 views
  • 1 like
  • 4 in conversation