DATA Step, Macro, Functions and more

Avoid the warning message

Reply
Frequent Contributor
Frequent Contributor
Posts: 76

Avoid the warning message

 

I would like to try to avoid the warning message:  

 

NOTE: Numeric values have been converted to character values at the places given by:

 

med_range =compress(round(median_,0.1)) || " ("||compress(round(min_,0.1))||"-"||compress(round(max_,0.1))||")";

 

If I use put function to change rouned value to character, what the best format I should use considering the big variance of the date value ?

 

Thank you very much.

Super User
Super User
Posts: 7,399

Re: Avoid the warning message

An example of your data as a datastep would be ideal.  At a guess:

data want;
  set have;
  med_range=cats(put(round(median_,.1),8.1)," (",put(round(min_,.1),8.1),"-",put(round(max_,.1),8.1),")");
run;
Super User
Posts: 17,784

Re: Avoid the warning message

Try using a CATT or CATS function instead. They do the conversion and I usually find it easier to read rather than the double pipe. 

You can usually avoid the COMPRESS() as well, since CATT trims variables. 

Frequent Contributor
Frequent Contributor
Posts: 76

Re: Avoid the warning message

Thank you very much, RW9 and Reeza, that helps !
Ask a Question
Discussion stats
  • 3 replies
  • 207 views
  • 0 likes
  • 3 in conversation