DATA Step, Macro, Functions and more

how to output the data with error

Reply
Frequent Contributor
Posts: 79

how to output the data with error

Hello,

 

I am randomly creating some datasets with missing data and do imputation with EM. However, rare events could happen and result in no convergence of GEE parameter estimates. 

 

How could I output the location of dataset with those kind of error message?

 

(Error in computing the variance function

Error in parameter estimate covariance computation

Error in estimation routine)

 

Thanks

 

Super User
Posts: 24,010

Re: how to output the data with error

Posted in reply to xiangpang

The log should indicate the data being used in that procedure?

Are you using a macro of some sort or batch processing? Make sure to specify the correct options to see all the relevant details in the log - the options depend on how you're running your code. 

 


@xiangpang wrote:

Hello,

 

I am randomly creating some datasets with missing data and do imputation with EM. However, rare events could happen and result in no convergence of GEE parameter estimates. 

 

How could I output the location of dataset with those kind of error message?

 

(Error in computing the variance function

Error in parameter estimate covariance computation

Error in estimation routine)

 

Thanks

 


 

Frequent Contributor
Posts: 79

Re: how to output the data with error

Thanks for your reply. Yes, the log did indicate the data with error. I am using MACRO. Because of thousands of random datasets, I am wondering whether there is an option I could use in the MACRO to output the datasets with error message. 

 

Thanks

Super User
Posts: 24,010

Re: how to output the data with error

Posted in reply to xiangpang

Try:

 

options mprint symbolgen;

This will give you the full log. You could also add a step after your PROC to test if it completed successfully and if not to output your data set name and a message to the log. 

 

%if &syserror %then %do;
%PUT ERROR:- &DATASETNAME errored out in this iteration;
%end;
Frequent Contributor
Posts: 79

Re: how to output the data with error

Hello Reeza,

 

Thanks for taking the time to think and respond to my issue.

 

In my understanding, your code just labeled the error, but not output the location of error. Am I right? For example, if there is an error in Nth imputation, how do I save this information? 

 

Also, I got the following error message. 

WARNING: Apparent symbolic reference SYSERROR not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand
       is required. The condition was: &syserror
ERROR: The macro EM will stop executing.
MPRINT(PROJECT):   ;
SYMBOLGEN:  Macro variable I resolves to 10
SYMBOLGEN:  Macro variable I resolves to 11
SYMBOLGEN:  Macro variable N_BOOT resolves to 10
Super User
Posts: 24,010

Re: how to output the data with error

Posted in reply to xiangpang

I don't know what you're trying to say here. I can provide code snippets but I can't see your program or what you submitted. The code I posted is wrong, the macro variable is called SYSERR, but it doesn't seem to capture regression errors. You'll probably need a different automatic macro variable. The list is here:

http://documentation.sas.com/?docsetId=mcrolref&docsetTarget=n18mk1d0g1j31in1q6chazvfseel.htm&docset...

 

You clearly have macro variables with all you need though, you could pass them to a data set or do anything you want within the %DO to store the information that are in other macro variables. 


@xiangpang wrote:

Hello Reeza,

 

Thanks for taking the time to think and respond to my issue.

 

In my understanding, your code just labeled the error, but not output the location of error. Am I right? For example, if there is an error in Nth imputation, how do I save this information? 

 

Also, I got the following error message. 

WARNING: Apparent symbolic reference SYSERROR not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand
       is required. The condition was: &syserror
ERROR: The macro EM will stop executing.
MPRINT(PROJECT):   ;
SYMBOLGEN:  Macro variable I resolves to 10
SYMBOLGEN:  Macro variable I resolves to 11
SYMBOLGEN:  Macro variable N_BOOT resolves to 10



Frequent Contributor
Posts: 79

Re: how to output the data with error

Thanks, happy to learn and I will read through it. 

Ask a Question
Discussion stats
  • 6 replies
  • 119 views
  • 0 likes
  • 2 in conversation