BookmarkSubscribeRSS Feed
mdoddala
Obsidian | Level 7
libname clinic '/home/mdoddala0';
data clinic.admit7;
set clinic.weightclub;
proc tabulate data=clinic.admit7;
class team;
var startweight endweight;
table team*(startweight endweight),mean;
run;

run;

 

Here is the code to create the weightclub dataset

input IdNumber 1-4 Name $6-20 Team $22-27 StartWeight 29-31 EndWeight 33-35;
Loss=StartWeight-EndWeight;
cards;
1023 David Shaw red 189 165
1049 Amelia Serrano yellow 145 124
1219 Alan Nance red 210 192
1246 Ravi Sinha yellow 194 177
1078 Ashley McKnight red 127 118

;

run;
 

17 REPLIES 17
stat_sas
Ammonite | Level 13

Hi,

 

Try this

 

proc tabulate data=clinic.admit7;
class team;
var startweight endweight;
table team,(startweight endweight)*mean;
run;
mdoddala
Obsidian | Level 7

still getting the errors:(

 Errors (2)
 ERROR: Variable StartWeight in list does not match type prescribed for this list.
 ERROR: Variable EndWeight in list does not match type prescribed for this list.
 Warnings
 Notes (7)
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname clinic '/home/mdoddala0';
NOTE: Libref CLINIC refers to the same physical library as KRRISH.
NOTE: Libref CLINIC was successfully assigned as follows:
Engine: V9
Physical Name: /home/mdoddala0
72 data clinic.admit7;
73 set clinic.weightclub;
 
NOTE: There were 5 observations read from the data set CLINIC.WEIGHTCLUB.
NOTE: The data set CLINIC.ADMIT7 has 5 observations and 6 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 799.53k
OS Memory 29100.00k
Timestamp 02/16/2019 04:09:31 AM
Step Count 115 Switch Count 3
Page Faults 0
Page Reclaims 181
Page Swaps 0
Voluntary Context Switches 46
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
74 proc tabulate data=clinic.admit7;
 
75 class team;
76 var startweight endweight;
ERROR: Variable StartWeight in list does not match type prescribed for this list.
ERROR: Variable EndWeight in list does not match type prescribed for this list.
77 table team,(startweight endweight)*mean;
78 run;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TABULATE used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 388.37k
OS Memory 28840.00k
Timestamp 02/16/2019 04:09:31 AM
Step Count 116 Switch Count 0
Page Faults 0
Page Reclaims 60
Page Swaps 0
Voluntary Context Switches 9
Involuntary Context Switches 0
Block Input Operations 288
Block Output Operations 0
 
Patrick
Opal | Level 21

@mdoddala 

A SAS data step must end with a RUN; command. Look at the code you've posted. Something is off there.

mdoddala
Obsidian | Level 7

I think it ended with a run; statement

mdoddala
Obsidian | Level 7
libname clinic '/home/mdoddala0';
data clinic.admit7;
set clinic.weightclub;
proc tabulate data=clinic.admit7;
class team;
var StartWeight EndWeight;
table team,(StartWeight EndWeight)*mean;
run;
data weightclub; 
input IdNumber 1-4 Name $6-20 Team $22-27 StartWeight 29-31 EndWeight 33-35;
Loss=StartWeight-EndWeight;
cards;
1023 David Shaw red 189 165
1049 Amelia Serrano yellow 145 124
1219 Alan Nance red 210 192
1246 Ravi Sinha yellow 194 177
1078 Ashley McKnight red 127 118
;
run

 

Patrick
Opal | Level 21

@mdoddala 

Please don't post the same question twice.

Answers here: https://communities.sas.com/t5/SAS-Programming/How-do-I-solve-the-errors/m-p/536113#M147292 

I suggest you delete your post here.

mdoddala
Obsidian | Level 7

I couldn't find an option to delete

Patrick
Opal | Level 21

@mdoddala 

You as the poster of the question should have access to below menu:

Capture.JPG

mdoddala
Obsidian | Level 7

@Patrick  Sir, this is what I'm seeing

delete.PNG

Patrick
Opal | Level 21

ok - then I also don't know how you could delete the whole post. Just leave it then.

mdoddala
Obsidian | Level 7

Haha alright sorry for any inconvenience:(

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

please mark you questions as solved to close the thread.  Be kind and do leave things behind.

 

Astounding
PROC Star
This message means that StartWeight and EndWeight are not numeric variables... they are character. The program you originally posted would have created them as numeric. Somehow a different program created clinic.weightclub

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 17 replies
  • 1483 views
  • 4 likes
  • 7 in conversation