05-03-2012 01:16 PM
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?
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.
05-03-2012 02:30 PM
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.