Lets start with the first case:
172 data NewData;
173 length Name $ 16;
174 input Jurisdiction $ ConfirmedCases ProbableCases TotalCases;
175 datalines;
NOTE: Variable Name is uninitialized.
NOTE: Invalid data for ConfirmedCases in line 176 17-25.
NOTE: Invalid data for ProbableCases in line 176 27-31.
NOTE: Invalid data for TotalCases in line 176 33-40.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
176 Jurisdiction Confirmed Cases Probable Cases Total Cases
Name= Jurisdiction=Jurisdic ConfirmedCases=. ProbableCases=. TotalCases=. _ERROR_=1 _N_=1
NOTE: Invalid data for ConfirmedCases in line 177 13-18.
NOTE: Invalid data for ProbableCases in line 177 21-25.
NOTE: Invalid data for TotalCases in line 177 29-34.
177 Delaware 15,930 1,012 16,942
Name= Jurisdiction=Delaware ConfirmedCases=. ProbableCases=. TotalCases=. _ERROR_=1 _N_=2
To get the RED line of data you placed the variable names in the data lines. So when you try to read the numeric ConfirmedCases variable the text "Confirmed" is read as numeric, and ERRORS.
Note that you value for Jurisdiction has been truncate to 8 characters. That is the result of using a simple $ informat on the input statement. This will only read 8 characters.
The BLUE line has numbers with commas in them. Since the comma can have several different meanings in numeric values you have to tell SAS by using a proper INFORMAT that will read them. I suspect that COMMA12. would work but I don't know the range of your values.
So for this bit you might have your input statement look something like:
input Jurisdiction :$15. ConfirmedCases :Comma12. ProbableCases :Comma12. TotalCases :Comma12.;
But you likely have yet another issue lurking: State names with embedded spaces like New York or North Carolina. The list input statement you are using will read each space separate value as the next variable. So "York" would attempt to be read into Confirmed Cases.
At which point the actual structure of the text becomes pretty critical for reading properly.
This one
259 data ListInput;
260 length Jurisdiction $ 14
261 input Jurisdiction $ Confirmed Cases Probable Cases Total Cases;
The Length statement is missing a ; to end it so there are lots of problems following. Regardless of the assigned length an Input like Jurisdication $ still only reads 8 characters. The spaces in the variable names mean that read the variable "Cases" 3 times and almost certainly never actually match the layout.
494 proc print data=FormatInput'
495 run;
496 data ColumnInput;
497 infile cards;
498 input Jurisdiction $ Confirmed_Cases Probable_Cases Total_Cases;
499 datalines;
The PROC PRINT ends with quote symbol, not a semicolon. From that point SAS expects a matching quote to close the first one. So none of the code from that point on runs at all because the quote and appropriate statements were not found at all. Depending what else you may have done you may have some fun getting SAS to recognize submitted code for awhile and may have to save your code and restart the SAS session.
... View more