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

I'm unable to view the SAS log file with over 4GB in either notepad++ or SAS EG. I got the following message when I tried to open the file.

 

File is too big to be opened by notepad++
Job.log is too large to open inside of Enterprise Guide and will be opened externally.

 

I know there is a way to view the file or extract the file via UNIX commands but I would like to know whether there is any other way to view the high volume file apart from UNIX enviornment. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
data mylog;
infile '/sasuser/asapp/Job.log' truncover;
input line $200.;
lineno = _n_;
if index(line,'ERROR');
if _n_ ge 10000 then stop;
run;

will scan through your log and find the ERROR lines (and only those). Since the line numbers are kept, you can then use those to extract excerpts (firstobs=, obs=) from the log.

View solution in original post

8 REPLIES 8
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Why have you ended up with a 4gb log file?  Try turning certain options off (options nomlogic nomprint nosymbolgen), break the log out into concise parts - i.e. modularise your code and output.  It sounds to me like you dumping a whole database out to the log, or doing vasat amounts of macro processing with macro options enabled.

Astounding
PROC Star

If you have no control over the size of the log file, you could try reading the log into a SAS data set that contains just one variable.  Each line of the log becomes a separate observation.  Then view the SAS data set.

 

You might be well-advised to change the program to break the log file up into pieces.  Use PROC PRINTTO to determine which sections of the log become part of which output file. 

Kurt_Bremser
Super User

A 4GB log file contains 4 billion characters. Assuming you can check 1000 characters per second, you would need 4 million seconds for this log, or roughly 1000 hours. So this file is useless for human consumption.

I'd simply delete that file and rerun the process that wrote it, and take care to stop it as soon as it starts to write mountains of text, so you can review it as long as it has a reasonable size.

Ksharp
Super User
Data step ?


data _null_;
 infile '/home/xx.log';
 input;
 putlog _infile_;
 if _n_ lt 100 then stop;
run;



Babloo
Rhodochrosite | Level 12

I tried the similar code, but it seems it didn't helped either. There is no difference in the log even if I change the number of iteration from 1000 to 10000 in the following SAS code. Appreciate your help here.

 

Code which I tried is

 

data _null_;
infile '/sasuser/asapp/Job.log';
input;
putlog _infile_;
if _n_ lt 1000 then stop;
run;

Log file :

 

NOTE: The infile '/sasuser/asapp/Job.log' is:
      Filename=/sasuser/asapp/Job.log,
      Owner Name=asapp,Group Name=grp,
      Access Permission=-rwxrwxrwx,
      Last Modified=21Mar2017:20:19:05,
      File Size (bytes)=4516790

1                                                          The SAS System                               09:54 Monday, March 21, 2017
NOTE: 1 record was read from the infile '/sasuser/asapp/Job.log'.
      The minimum record length was 132.
      The maximum record length was 132.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      user cpu time       0.00 seconds
      system cpu time     0.01 seconds
      memory              779.03k
      OS Memory           20652.00k
Babloo
Rhodochrosite | Level 12

Thank you for quick reply and it resolve the issue. Could you please tell me how can we tweak the same code to look for the word 'ERROR:' in log file and if it is there, it have to print till that line in log window. So that I can easily find out the error message and can investigate the issue.

 

I know that findw function is used to look for words, but I'm not sure how to utilize this function for this scenario.

Kurt_Bremser
Super User
data mylog;
infile '/sasuser/asapp/Job.log' truncover;
input line $200.;
lineno = _n_;
if index(line,'ERROR');
if _n_ ge 10000 then stop;
run;

will scan through your log and find the ERROR lines (and only those). Since the line numbers are kept, you can then use those to extract excerpts (firstobs=, obs=) from the log.

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
  • 3945 views
  • 5 likes
  • 5 in conversation