* Fixed Column data; * There are three problems that prevent you from using list input here: spaces occur within team names, missing data is just a blank space, and there is no space between two of the data values in observation three; * Missing data at the end of a line does not cause flowover; data sales; input VisitingTeam $ 1-20 ConcessionSales 21-24 BleacherSales 25-28 OurHits 29-31 TheirHits 32-34 OurRuns 35-37 TheirRuns 38-40; total_sales = sum(concessionSales, bleachersales); format total_sales concessionsales bleachersales dollar8.2; datalines; Columbia Peaches 35 67 1 10 2 1 Plains Peanuts 210 2 5 0 2 Gilroy Garlics 151035 12 11 7 6 Sacramento Tomatoes 124 85 15 4 9 1 ; proc print; run; * Two records per observation; data sales; input VisitingTeam $ 1-20; input ConcessionSales 1-3 BleacherSales 4-7 OurHits 9-10 TheirHits 12-13 OurRuns 16 TheirRuns 19; total_sales = sum(concessionSales, bleachersales); format total_sales concessionsales bleachersales dollar8.2; datalines; Columbia Peaches 35 67 1 10 2 1 Plains Peanuts 210 2 5 0 2 Gilroy Garlics 151035 12 11 7 6 Sacramento Tomatoes 124 85 15 4 9 1 ; proc print; run; * Two other useful features of column input are: (1) you don't have to read every column, only the variables you are intersted in, and (2) you don't have to read the columns in order.; data sales; input TheirRuns 38-40 OurRuns 35-37; length winner $ 4; if ourruns gt theirruns then winner = "us"; else if ourruns lt theirruns then winner = "them"; else if ourruns eq theirruns then winner = "draw"; datalines; Columbia Peaches 35 67 1 10 2 1 Plains Peanuts 210 2 5 0 2 Gilroy Garlics 151035 12 11 7 6 Sacramento Tomatoes 124 85 15 4 9 1 ; proc print data=sales; run; * It is also possible to mix "list" and "column" input specifications.; data sales; input VisitingTeam $ 1-20 ConcessionSales 21-24 BleacherSales 25-28 OurHits TheirHits OurRuns TheirRuns; total_sales = sum(concessionSales, bleachersales); format total_sales concessionsales bleachersales dollar8.2; datalines; Columbia Peaches 35 67 1 10 2 1 Plains Peanuts 210 2 5 0 2 Gilroy Garlics 151035 12 11 7 6 Sacramento Tomatoes 124 85 15 4 9 1 ; proc print; run;