hi I have a table that divede one amt into another an it comes out with a decimal I need to add the % sign to the output
example
( sales/ inventory)as percentage_sales;
5/10. = 0.5 I need to read 50% ...thanks for your assistance in this matter
( sales/ inventory) as percentage_sales format=percent8. ;
( sales/ inventory) as percentage_sales format=percent8. ;
Xia Keshan,
It applied the symbol but when I export it was removed an reverted back to decimal ... How can I keep the symbol when it's exporting out to excel? Thanks
Post example data in the forma of a datastep, and describe how you are exporting the data. Generally speaking, I would be using the tagsets.excelxp and a proc report, so would just add the Excel format to the column:
http://support.sas.com/resources/papers/proceedings10/031-2010.pdf
But it depends on how your data is, and how you are exporting.
You'd better post it at ODS and REPORT forum, It looks like ODS problem , You need some special style like : style={tagattr="format:@"}
I Have a table like this
a.no,
a.market,
(a.sales/a.inventory) as percent format= percent8.,
from want a left join table b. On a.no=b.no
);run;
Proc export data = want1
outfile= sharepoint
dbms=excel replace;
newfile=yes;
run;
I converted it to character it works
Yes, that will work. I would recommend however you 1) don't use proc export, it is a guessing procedure, i.e. it guesses what you want to do. 2) use proc report and ods tagsets.excelxp, this has a lot more functionality, and you can set formats as per the link I gave you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.