BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
djbateman
Lapis Lazuli | Level 10

I have found an issue that I have resolved, but I wanted someone to explain to me why it might be happening and if there is a workaround.

 

In general, we store a log file for every program we run.  After the program runs, we run the log file through another macro that searches for errors/warnings and returns a report informing us if there are issues in the log.  I found an instance where the log report claimed that there were no issues, but the expected output file was never created.  When I manually searched the log, I found that there was a single error at the bottom of the log file.  The log file has 3153 rows, but when I examined the log summary macro, I found that only 2261 lines were being read in.

 

This is line 2261 where SAS stops reading in the log file:

 

 

%createcheck(chk=102, whr=%str(exftrt='Elexacaftor/Tezacaftor/Ivacaftor' & timepart(dosetm)>='15:00't), keepvars=&idvars. visitmnemonic exftrt dosedttm comment resolved, message=%str(Study drug dose time is expected to be in the morning));

 

 

I found that the log is translating the ">=" into a right-pointing arrow.  Further, the ")," after denoting that a character string as a time value is translated into an Extra-High Tone Bar (unicode ID: U+02E5).  When I attached the log file, and those special characters disappear, so below is a screen shot of lines 2259-2267.

 

Log_Screenshot.PNG

 

I'm assuming that the arrow is telling SAS that it found the end of a file and stopped reading in more data because I fixed the code by changing ">=" to "ge", and the code ran fine with the log report detecting the error message at the bottom of the page.  It seems that the tone bar is not influencing the log report at all.

 

My concern is that I have never used "ge" before but have always used ">=".  I'm concerned about how many times in my log reports issues were not detected because the file was prematurely stopped when reading it in.  This is especially concerning because line 2267 in the screenshot above does not translate ">=" into an arrow.  Has anyone else had to deal with this problem?  Is there a way to deal with it without going through all programs that I am running regularly (literally hundreds of program files) and searching them all for ">="?

1 ACCEPTED SOLUTION

Accepted Solutions
djbateman
Lapis Lazuli | Level 10

This whole thing might be a moot point.  After I fixed the error in the log, this arrow is no longer being created, and the program doesn't stop reading in the log file prematurely.

View solution in original post

2 REPLIES 2
djbateman
Lapis Lazuli | Level 10

This whole thing might be a moot point.  After I fixed the error in the log, this arrow is no longer being created, and the program doesn't stop reading in the log file prematurely.

Rick_SAS
SAS Super FREQ

Crazy problem! I cannot reproduce the problem, but I do have an equally crazy suggestion: use a file extension (such as '.log' or '.txt') for the file that you are writing.

 

When some text editors open a file that does not have an extension, they try to guess what kind of file it is. If a text editor thinks it is viewing an HTML file, it will try to interpret "&token;" and "<stuff>" as HTML tags. (For example, in html, &rarr; is the tag for a right arrow.)  

 

I don't actually believe my conjecture is affecting you because (1) Notepad is supposed to open files as a plain text file, and (2) I don't see how those symbols could possibly be generated by what you've shown. Still, it doesn't hurt to add '.log' to the end of your text files.  

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 533 views
  • 1 like
  • 2 in conversation