Hi,
I've imported a csv with dollar values that have $ and commas (e.g. $1,000). This imports as a character variable in SAS 9.4 (which is what I'm using). I'm using a data step and COMPRESS to try to eliminate the commas and $ so I can then convert this to a numeric field. Here's the gist of what I have
data file_name;set file_name;
newvar=compress(oldvar,'$',',');
run; [then in a subsequent data step I convert it to numeric)
This eliminates the $, but the commas remain (i.e. it would now read '1,000'). I also get the following warning:
WARNING: In a call to the COMPRESS function or routine, the modifier "," not valid.
There is no possible way I am the only SAS user with this problem, but I can't seem to find a solution anywhere. What am I doing wrong? Thanks in advance!
... View more