BookmarkSubscribeRSS Feed
brophymj
Quartz | Level 8

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

;


3 REPLIES 3
Kurt_Bremser
Super User

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.

;

mohamed_zaki
Barite | Level 11

data test;

   infile datalines DLM = ',';

format field1 COMMA10. lossyr 20.;

input field1 lossyr;

DATALINES ;

12346756,2014

;

run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 738 views
  • 0 likes
  • 4 in conversation