Hi:
There is another way to read your data, using simple list input (not formatted input), as described here:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001066690.htm
Although you can use mixed input types, when you used $5. to read LASTNAME, you changed from list input to "formatted input", as described here:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001052077.htm
Note that, as it says at the end of the topic -- SAS read formatted input until it has read the number of positions specified by the INFORMAT. In your case, $5. was considered to be the INFORMAT for the LASTNAME field.
So when you had
[pre]
input firstname $ lastname $5. ... ;
[/pre]
You started with simple list input for FIRSTNAME, and then, switched to formatted input for LASTNAME. I'm not sure how you read HOURS -- with formatted or list input.
You can use a LENGTH statement with simple list input to specify the maximum length for a character variable that you are going to read with list input. If you specify the length, then list input will read until it hits a delimiter (the default delimiter for list input is a space or blank -- although, you can change it with the DLM option).
The program below reads your data without using the colon modifier.
cynthia
[pre]
data hourdata;
length firstname $8 lastname $15;
infile datalines;
input firstname $ lastname $ hours;
return;
datalines;
Andy Lee 150
Adam Jack 200
Mary Jacob 300
John Jingleheimer 400
;
run;
ods listing;
proc contents data=hourdata;
title 'PROC CONTENTS';
run;
proc print data=hourdata;
title 'PROC PRINT';
run;
[/pre]