Hello,
I would like to ask how to output the warning when data format is incorrect? The warning is to be printed in Out screen or Results Viewer Screen or a popped out window screen, not Log, because there are a lot of information shown in the Log.
My data(AA) looks like this:
ID birth Transfer
01 02/30/1997 .
02 05/23/1992 1992-05-23
I want to show the following information
_ERROR_=1 ; WARNING! INVALID DATE FOR SAS; data=AA, ID=01, birth=02/30/1997
Thanks for your help!
Where exactly do you want this output?
In the Results Pane?
That'll be a manual process, whereas the log could be directed to a file instead?
How about showing this in Results Viewer Screen?
I don't need the full log but just the error messege.
The warning information should be specific, and need to identify for which SAS dataset, for which record (row), for which variable (column), and the data with wrong date value.
The simplest approach - note the records via a flag and then use PROC PRINT to display the results to the log.
However, each check is manual so you will have to code this how you want it to look.
Thank you all very much.
So you means to save the log then import again and using proc print to print what I want?
@Irenech34 wrote:
Thank you all very much.
So you means to save the log then import again and using proc print to print what I want?
That's one approach.
Another is to save the errors in a data set themselves and then print that out.
The first approach only works if a SAS 'error' is the same as your error definition, which I don't think is true.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.