DATA Step, Macro, Functions and more

all hash contents printed to sas log

Accepted Solution Solved
Reply
New Contributor obj
New Contributor
Posts: 3
Accepted Solution

all hash contents printed to sas log

Hi,

 

I cannot find a solution for the following problem, which I additionaly do not understand.

I have a large data step with several hash objects and iterators. Somehow at the start of a new observation the full content of all objects is printed to log (which slow down the computing time massively). The follwing WARNING is printed to the SAS log:

 

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

 

However this only happens when the lookup object was succesful.

 

I tried to produce a smaller test macro, but failed to reproduce the warnings, it only happens when I ran with full glory (maybe some hash limits are reached?). I know its difficult to find out based on the information I provide, however I want to know when and why hash objects write contents to the log?

 

Here is a small example how I initialize has objects.

 

%macro checkerrs;
data _null_;
	set dataset;

	if _n_ = 1 then do;
	declare hash lookupdata;
	        lookupdata = _new_ hash(dataset:"check_rebal", ordered:"yes");
			lookupdata.defineKey( "Date", "ID" );
			lookupdata.defineData( "var1", "varN" );
			lookupdata.defineDone();
				format var1 best.;
				format varN best.;
	end;

	rc = lookupdata.find();
	if rc=0 then put Date_ Date ID var1;

run;
%mend; %checkerrs;

 

I'm on version 9.4 TS Level 1M4.

 

many thanks in advance for any help.

 


Accepted Solutions
Solution
‎06-13-2017 05:16 AM
Super User
Posts: 11,343

Re: all hash contents printed to sas log

The message

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

is exactly that. You are doing something causing an error, which is the reason "Somehow at the start of a new observation the full content of all objects is printed to log". The most frequent cause is attempting do something with a value that is not valid. SAS provides a dump of the values so that you can determine which value(s) for which variables. By default SAS only displays 20 of the messages and then has the Warning which indicates that you likely have many more errors and your results are going to be invalid.

You should post a couple of the error messages.

 

Without seeing data I it is hard to provide more details though a common cause is mixind numeric and character such as attempting key on a numeric variable when the data in your set is character or vice versa.

View solution in original post


All Replies
Solution
‎06-13-2017 05:16 AM
Super User
Posts: 11,343

Re: all hash contents printed to sas log

The message

WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.

is exactly that. You are doing something causing an error, which is the reason "Somehow at the start of a new observation the full content of all objects is printed to log". The most frequent cause is attempting do something with a value that is not valid. SAS provides a dump of the values so that you can determine which value(s) for which variables. By default SAS only displays 20 of the messages and then has the Warning which indicates that you likely have many more errors and your results are going to be invalid.

You should post a couple of the error messages.

 

Without seeing data I it is hard to provide more details though a common cause is mixind numeric and character such as attempting key on a numeric variable when the data in your set is character or vice versa.

New Contributor obj
New Contributor
Posts: 3

Re: all hash contents printed to sas log

Hi,

thanks a lot for your input. unfortunately there are no other warnings or error messages. However I managed to find the relevant part in the code by looking in detail into the dumps and in fact is was a numeric-character mixture that triggered the dumps.

 

many thanks.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 112 views
  • 0 likes
  • 2 in conversation