Hi All,
I am creating a .csv file in mainframe using SAS and email the file as an attachment. When I open the file the numeric data, for example, customer id 1234567898 is converted into 123E.11 something like that.
Could you please let me know how I can retain the format of the numeric variable in .CSV file( I know when I open the .csv file in Excel this weird conversion happens).
Please help.
Thanks
Don't open in Excel, or make the columns wider the appearnce should change.. CSV does not have any format information in the file, it is only text.
Hi All,
Thanks for the reponse.
Here is how I finally achieved retining the format of numeric variable in .CSV file.
data _null_;
file filout;
if _n_=1 then do;
put @1 '="'
@2 'Num variable'
@10 '"';
end;
put @2 num_var;
run;
The above trick works!
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.