Your SAS programs, embedded in web apps and elsewhere

How to present log scanning results from Stored Process

Posts: 1,233

How to present log scanning results from Stored Process


Suppose I'm writing a stored process that will be invoked from stored process web app.  The SP generates a report (html/pdf/rtf).  After the report is produced, I'd like to parse the log to look for any bad messages, and present them to the user.  How best to do the presentation part?

So I will use proc printto to redirect the log, and I have a log parser macro that will create a dataset of bad log messages, but how should I present this info to the user?

I was thinking of using javascript alert to pop up an alert: "Bad stuff in log", but you can't present a lot of text in an alert box. And of course any of these alerts would be shown only AFTER the report has been generated (and displayed).

Which makes me think maybe the best approach would be something like:

1. Run the report but write it to a temp location somewhere

2. Scan log for bad messages

3. If bad messages found, display them to user

   else display report

Since I'm just getting started with stored processes, was hoping to get feedback from others on how you approach log scanning and returning the results to the user.  It was all so simple in DMS/batch SAS....

I realize if there is a "fatal" error the user will realize it.  But I want to catch other errors (uninitialized variables, missing data, etc) that only show up as notes or warnings when (undocumented) note2err is not set.



Regular Contributor
Regular Contributor
Posts: 166

Re: How to present log scanning results from Stored Process


Not too sure that you can show your warnings in the same output itself.

However if you are giving a html output then you can look at adding a button to your _webout output --- SHOW ALL WARNINGS .

And link it to execute either a second stored process to provide the output of your log or replay the same STP and use the current session itself to show the messages in the LOG.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation