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.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: 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-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
  • 1 reply
  • 733 views
  • 0 likes
  • 2 in conversation