02-26-2015 02:12 PM
CAN SOME ONE RECOMMEND ME ANY PERMANENT FIX REMOVING DOLLAR SIGN($) IN FRONT OF RECORDS(Numbers). NOT THE (INFORMAT) AS THE TABLES ARE MOVING FROM SQL TO SAS. THE VARIABLES SHOULD NOT CHANGE FROM NUMERIC TO CHARACTER.
02-26-2015 02:34 PM
DON'T TYPE IN ALL CAPS
What do your variables look like, are they character or numeric to start with? What format/informat and how are you moving the tables that you are having this problem?
02-26-2015 02:43 PM
Thanks for your prompt response. The tables were created in SQL.
Ex: The values for a variable called Invoice like
I want those values with out $. Tried (Informat Invoice comma11.). Did not work and dollar was still there. Used a complicated process
1) compress(It converted Invoice to character)
2) then used Input( to convert them to numerice)
I know there must be a best way to do it which I am not aware of. What can we do to permanently fix this by creating a piece of code to avoid doing all those stuff above?
Sorry I am very new to SAS.
02-26-2015 02:56 PM
INformat controls how a variable is IMported.
Format is how it is display. Apply a format, such as BEST32. instead to see the result.
format var best32.;
02-26-2015 03:01 PM
Thanks for your reply.But I want the dollar to be removed and the variable should end up with numeric values. It is possible using compress and Input but I want a piece of code that does that job without writing code again.
02-26-2015 03:04 PM
Then you either need to fix it in your SQL tables or in however you bring it into SAS, which you haven't explained.
Note that format will leave the variable as numeric and is more efficient than compress/input.