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

 

…..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
Fluorite | Level 6

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
Fluorite | Level 6

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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 846 views
  • 1 like
  • 4 in conversation