Re: Changing values of SAS column Posted 12-17-2020 10:17 AM (2632 views) | In reply to aalluru You can use either PROC FORMAT or a data step. PROC FORMAT does not make the variable numeric, the variable rema
*** to Find Data Type ***;proc contents data=&dcds order=varnum out=&dcds.var(keep=name varnum type) noprint; Run;proc sort data =&dcds.var ; By varnum; RUn;*** For Numeric to character ***;Proc Sql noprint; Select count(distinct type) into: dc_cnt_num fr...
I have eventually formatted it to include ruppee sign. main code: data Amazon.Products_mod;set Amazon.Products_Nodup;A_Price= input(compress(actual_price, , 'kd'), comma10.);put "Actual Price (numeric):" A_Price comma10.;format A_Price currency_fmt.;D_Price= input(compr...
*** to Find Data Type ***;proc contents data=&dcds order=varnum out=&dcds.var(keep=name varnum type) noprint; Run;proc sort data =&dcds.var ; By varnum; RUn;*** For Numeric to character ***;Proc Sql noprint; Select count(distinct type) into: dc_cnt_num fr...
is your variable hisp_not numeric or character? 0 Likes Reply Special offer for SAS Communities members Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida...
There is no such thing as datetime variable in SAS. There are only 2 types of variables in SAS: numeric and character. I suggest you check the type of variable stored within each dataset (using the dictionaries - sashelp.vcolumn, in this case) and act accordingly based on type of variabl...
I suspect that YMDOD is actually a character variable that happens to contain digits, not a numeric variable. A PROC CONTENTS would reveal that. If that's the case, you need a simpler, slightly different solution: data want; set have; ymdod_formatted = input(ymdod, yymmn6.); f...