Hi, I'm preparing for the Base SAS Programming certification and am currently reading chapter 17: reading free-format data (Third Edition). I tried executing the code snippet on page 543, in which the data step reads a range of numeric variables and specifies a format for it. I am working on SAS University Edition. The following is my code snippet: filename sf '/folders/myfolders/salesfmtd.txt';
data salesfmtd;
infile sf;
input Name $ (Sales1-Sales3) (7.);
run; The salesfmtd.txt file has the following contents: X 1500 1280 1800 Y 1260 1700.345 1900 Z 1600.076 1450 1720 The output data contains just one record as follows: X . . . i.e. the values are missing and represented by a period. The log displays the following notes: NOTE: Invalid data for Sales1 in line 1 3-9. NOTE: Invalid data for Sales2 in line 1 10-16. NOTE: Invalid data for Sales3 in line 2 1-7. RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 2 Y 1260 1700.345 1900 20 NOTE: Invalid data errors for file SF occurred outside the printed range. NOTE: Increase available buffer lines with the INFILE n= option. Name=X Sales1=. Sales2=. Sales3=. _ERROR_=1 _N_=1 NOTE: Invalid data for Sales2 in line 3 10-16. NOTE: LOST CARD. NOTE: Invalid data errors for file SF occurred outside the printed range. NOTE: Increase available buffer lines with the INFILE n= option. Name=Z Sales1=1600.07 Sales2=. Sales3=. _ERROR_=1 _N_=2 NOTE: 3 records were read from the infile SF. The minimum record length was 16. The maximum record length was 20. NOTE: SAS went to a new line when INPUT statement reached past the end of a line. NOTE: The data set WORK.SALESFMTD has 1 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.02 seconds cpu time 0.01 seconds Can someone please tell me where the problem lies? I don't see why there could be a problem with specifying 7. as the format. Thanks in advance!
... View more