我的数据格式为百万,我需要在 SAS 中将我的数据以十进制数百万制表。
我的数据包含数百万美元的租金,即 1,260,678.21,我希望将其制成十进制数百万,即“1.3”。
我试图创建自己的函数来划分如下:
/***/
* 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;
但是我收到错误:
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).
有人会熟悉这个问题吗?