COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

SAS Beginner Pls Help

• Email
• Follow

```Hi

I am a beginner in SAS and dont know how to solve the below mentioned
error.

I am sending the DATA the LOG error and the Program for your
reference.

Your help will be highly appriciated.
Thanks,
Hemal

DATA:

Silent Lady  Maalea  sail  sch 75.00
America II   Maalea  sail  yac 32.95
Aloha Anai   Lahaina sail  cat 62.00
Ocean Spirit Maalea  power cat 22.00
Anuenue      Maalea  sail  sch 47.50
Hana Lei     Maalea  power cat 28.99
Leilani      Maalea  power yac 19.99
Kalakaua     Maalea  power cat 29.50
Reef Runner  Lahaina power yac 29.95
Blue Dolphin Maalea  sail  cat 42.95

Program:

DATA boats;
INFILE 'C:\MyRawData\boats.dat';
INPUT Name \$ 1-12 Port \$ 14-20 Locomotion \$ 22-26 Type \$ 28-30 Price \$
32-36;
* Tabulations with two dimensions and statistics;
PROC TABULATE DATA = boats;
ClASS Locomotion Type;
VAR Price;
TABLE Locomotion ALL, MEAN*Price*(TYPE ALL);
TITLE 'Mean Price by Locomotion and Type';
RUN;

LOG Error:

DATA boats;
60   INFILE 'C:\MyRawData\boats.dat';
61   INPUT Name \$ 1-12 Port \$ 14-20 Locomotion \$ 22-26 Type \$ 28-30
Price \$ 32-36;

62   * Tabulations with two dimensions and statistics;

NOTE: The infile 'C:\MyRawData\boats.dat' is:
File Name=C:\MyRawData\boats.dat,
RECFM=V,LRECL=256

NOTE: 10 records were read from the infile 'C:\MyRawData\boats.dat'.
The minimum record length was 36.
The maximum record length was 36.
NOTE: The data set WORK.BOATS has 10 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time           0.23 seconds
cpu time            0.18 seconds

63   PROC TABULATE DATA = boats;
64   ClASS Locomotion Type;
65   VAR Price;
ERROR: Variable Price in list does not match type prescribed for this
list.
66   TABLE Locomotion ALL, MEAN*Price*(TYPE ALL);
67   TITLE 'Mean Price by Locomotion and Type';
68   RUN;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TABULATE used (Total process time):
real time           0.06 seconds
cpu time            0.01 seconds

```
 0

See related articles to this posting

```On Feb 12, 1:29=A0pm, hemal <hem...@gmail.com> wrote:
> Hi
>
> I am a beginner in SAS and dont know how to solve the below mentioned
> error.
>
> I am sending the DATA the LOG error and the Program for your
> reference.
>
> Your help will be highly appriciated.
> Thanks,
> Hemal
>
> DATA:
>
> Silent Lady =A0Maalea =A0sail =A0sch 75.00
> America II =A0 Maalea =A0sail =A0yac 32.95
> Aloha Anai =A0 Lahaina sail =A0cat 62.00
> Ocean Spirit Maalea =A0power cat 22.00
> Anuenue =A0 =A0 =A0Maalea =A0sail =A0sch 47.50
> Hana Lei =A0 =A0 Maalea =A0power cat 28.99
> Leilani =A0 =A0 =A0Maalea =A0power yac 19.99
> Kalakaua =A0 =A0 Maalea =A0power cat 29.50
> Reef Runner =A0Lahaina power yac 29.95
> Blue Dolphin Maalea =A0sail =A0cat 42.95
>
> Program:
>
> DATA boats;
> INFILE 'C:\MyRawData\boats.dat';
> INPUT Name \$ 1-12 Port \$ 14-20 Locomotion \$ 22-26 Type \$ 28-30 Price \$
> 32-36;
> * Tabulations with two dimensions and statistics;
> PROC TABULATE DATA =3D boats;
> ClASS Locomotion Type;
> VAR Price;
> TABLE Locomotion ALL, MEAN*Price*(TYPE ALL);
> TITLE 'Mean Price by Locomotion and Type';
> RUN;
>
> LOG Error:
>
> DATA boats;
> 60 =A0 INFILE 'C:\MyRawData\boats.dat';
> 61 =A0 INPUT Name \$ 1-12 Port \$ 14-20 Locomotion \$ 22-26 Type \$ 28-30
> Price \$ 32-36;
>
> 62 =A0 * Tabulations with two dimensions and statistics;
>
> NOTE: The infile 'C:\MyRawData\boats.dat' is:
> =A0 =A0 =A0 File Name=3DC:\MyRawData\boats.dat,
> =A0 =A0 =A0 RECFM=3DV,LRECL=3D256
>
> NOTE: 10 records were read from the infile 'C:\MyRawData\boats.dat'.
> =A0 =A0 =A0 The minimum record length was 36.
> =A0 =A0 =A0 The maximum record length was 36.
> NOTE: The data set WORK.BOATS has 10 observations and 5 variables.
> NOTE: DATA statement used (Total process time):
> =A0 =A0 =A0 real time =A0 =A0 =A0 =A0 =A0 0.23 seconds
> =A0 =A0 =A0 cpu time =A0 =A0 =A0 =A0 =A0 =A00.18 seconds
>
> 63 =A0 PROC TABULATE DATA =3D boats;
> 64 =A0 ClASS Locomotion Type;
> 65 =A0 VAR Price;
> ERROR: Variable Price in list does not match type prescribed for this
> list.
> 66 =A0 TABLE Locomotion ALL, MEAN*Price*(TYPE ALL);
> 67 =A0 TITLE 'Mean Price by Locomotion and Type';
> 68 =A0 RUN;
>
> NOTE: The SAS System stopped processing this step because of errors.
> NOTE: PROCEDURE TABULATE used (Total process time):
> =A0 =A0 =A0 real time =A0 =A0 =A0 =A0 =A0 0.06 seconds
> =A0 =A0 =A0 cpu time =A0 =A0 =A0 =A0 =A0 =A00.01 seconds

Note this line in the log:
Variable Price in list does not match type prescribed for this

You've set price to be a character variable, thus it can't be used as
an analysis variable. Change your input to read price as a numeric
variable by removing the dollar sign from the input line.
```
 0