zhuoer
zhuoer

Reputation: 617

What difference does the colon make on an input statement?

data test;
   input country $8. date mmddyy10.;
cards;
Germany 12/31/2000
France  01/31/2001
;
run;

In the 2nd line, can I use input country $8. date : mmddyy10.; ?

What's the difference between them?

Upvotes: 1

Views: 139

Answers (1)

Laurent de Walick
Laurent de Walick

Reputation: 2174

The colon will cause input statement to read from the first non-blank character on the line. Compare the next two data steps. The first will return a missing date for Germany, the second will contain 12/31/2000.

data test1;
   input country $8. date mmddyy10.;
cards;
Germany       12/31/2000
France  01/31/2001
;
run;

data test2;
   input country $8. date : mmddyy10.;
cards;
Germany       12/31/2000
France  01/31/2001
;
run;

Upvotes: 3

Related Questions