When I run this, the format for field1 should be 12,346,756 but it's 12346756
data test;
infile datalines DLM = ',';
input
field1 : comma10.0
lossyr : 20.
;
DATALINES ;
12346756,2014
;
Correct my previous version of this post.
You are only _using_ an ínformat, but you have not assigned any display format.
Add
format
field1 comma10.0
lossyr 20.
;
data test;
infile datalines DLM = ',';
format field1 COMMA10. lossyr 20.;
input field1 lossyr;
DATALINES ;
12346756,2014
;
run;
Yes, you have read the data in as comma10.0, i.e. the input reads the data in that format, buy you have not applied a format to the variable.
data test;
infile datalines DLM = ',';
input
field1 : comma10.0
lossyr : 20.;
format field1 comma10.0;
DATALINES ;
12346756,2014
;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.