My data is in the format of million and I need to tabulate my data as decimal millions in SAS.
I have data containing rent in millions of dollars i.e. 1,260,678.21 which I hope to tabulate as decimal millions i.e "1.3".
I attempted to create my own function to divide by as follows:
/***/
* create a function to round
*;
proc fcmp outlib=work.function.sample;
function round1000x(value);
return(round(value/1000000,1));
endsub;
run;
*
* make function available
*;
options cmplib=work.func;
*
* create a format that uses the function
*;
proc format;
value round1000x.;
run;
/*use this format in a proc tabulate statement*/
proc tabulate data=my_data format=round1000x.;
var rent_cost;
table rent_cost;
run;
However I am getting the error:
ERROR: The format ROUND1000X has a label that defines another format to be
loaded (named ROUND1000X), but this format could not be
successfully loaded (possibly for the same reason).
Would anyone be familiar with this problem?