BookmarkSubscribeRSS Feed
Quentin
Super User

Hi,

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.

Thanks,

--Q.

The Boston Area SAS Users Group (BASUG) is hosting an in person Meeting & Training on June 27!
Full details and registration info at https://www.basug.org/events.
1 REPLY 1
NN
Quartz | Level 8 NN
Quartz | Level 8

Hi,

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.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1143 views
  • 0 likes
  • 2 in conversation