Thanks for your answers. The log of dkvj’s program is
FOZZIE=a,b,d ANIMAL= RANKAN=13 _ERROR_=0 _N_=1
FOZZIE=1,2,3 ANIMAL= RANKAN=13 _ERROR_=0 _N_=2
FOZZIE=1,2,3 ANIMAL= RANKAN=13 _ERROR_=0 _N_=3
FOZZIE=1,2,3 ANIMAL= RANKAN=13 _ERROR_=0 _N_=4
FOZZIE=1,2,3 ANIMAL= RANKAN=13 _ERROR_=0 _N_=5
FOZZIE=1,2,3 ANIMAL= RANKAN=13 _ERROR_=0 _N_=6
This means that there is the carriage return at the end of each line? But why is there an error only with the variable name?
I found out that I have exactly the same problem with *.txt-files, e.g. Example 1from Proc Import, SAS Online doc 9.1.3: The last variable name ‘revenue’ is not imported. I guess I will have that problem with all files created under Windwos and imported to Unix-SAS?
The solution with the rename statement is not an option for me, as I want to import a great number of similar datasets automatically. There are basically the same variables in the datasets, however, in some datasets there are a few additional variables, so I don’t know the name of the last variable. For the same reason I don’t want to use the input statement: I couldn’t do the import automatically.
With Cynthia’s code, an error was produced in each line and the third column of the data set contains missings. Here is what the log says:
NOTE: Invalid data for oscar in line 2 5-6.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----
2 CHAR 1,2,3. 6
ZONE 323230
NUMR 1C2C3D
kermit=1 gonzo=2 oscar=. _ERROR_=1 _N_=1
NOTE: Invalid data for oscar in line 3 5-6.
3 CHAR 1,2,3. 6
ZONE 323230
NUMR 1C2C3D
kermit=1 gonzo=2 oscar=. _ERROR_=1 _N_=2
NOTE: Invalid data for oscar in line 4 5-6.
4 CHAR 1,2,3. 6
ZONE 323230
NUMR 1C2C3D
kermit=1 gonzo=2 oscar=. _ERROR_=1 _N_=3
NOTE: Invalid data for oscar in line 5 5-6.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----
5 CHAR 1,2,3. 6
ZONE 323230
NUMR 1C2C3D
kermit=1 gonzo=2 oscar=. _ERROR_=1 _N_=4
NOTE: Invalid data for oscar in line 6 5-6.
6 CHAR 1,2,3. 6
ZONE 323230
NUMR 1C2C3D
kermit=1 gonzo=2 oscar=. _ERROR_=1 _N_=5
NOTE: 5 records were read from the infile '/data/fast/mis/ca/muell/test.csv'.
The minimum record length was 6.
The maximum record length was 6.
NOTE: The data set WORK.MUPPETS has 5 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.10 seconds
cpu time 0.02 seconds