I found the following codes on SAS website, but couldn't understand what is the function of ":" here after input statement.
data recessions;
input startdate :date7. enddate :date7.;
format startdate enddate date7.;
datalines;
01Mar01 01Nov01
01Dec07 01Jun09
;
run;
In list input, normally you are not allowed to supply an informat in the input statement; it is expected to be in an informat
statement.
data recessions;
informat startdate enddate date7.;
format startdate enddate date7.;
input startdate enddate;
datalines;
01MAR01 01NOV01
01DEC07 01JUN09
;
run;
However, a colon turns it into modified list input, which allows for the specification of an informat directly in the input statement.
Without that colon, SAS would interpret the informat to mean you wanted formatted input, which does not work (well) with delimited data like you have in those datalines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With