BookmarkSubscribeRSS Feed
Allen799
Calcite | Level 5

I am not getting an output. Receiving an error stating All values missing for plot of PayrollAW*AttendanceAW

 

I am brand new this so any advice you be appreciated. 

 

Data Homework4;
input Team $ AttendanceAW PayrollAW;
Datalines;
ARI 2,134,375 $106,580,200
ATL 2,505,252 $119,705,250
BAL 2,028,424 $161,621,633
BOS 2,917,678 $200,550,750
CHC 3,199,562 $177,210,667
CHW 1,629,470 $97,842,000
CIN 1,836,917 $79,315,786
CLE 2,048,138 $114,427,167
COL 2,953,650 $106,650,000
DET 2,321,599 $118,375,600
HOU 2,403,671 $157,656,400
KCR 2,220,370 $127,555,817
LAA 3,019,585 $181,125,500
LAD 3,765,856 $201,466,263
MIA 1,583,014 $111,591,100
MIL 2,627,705 $68,439,300
MIN 2,051,279 $103,932,500
NYM 2,460,622 $176,615,252
NYY 3,154,938 $182,424,700
OAK 1,475,721 $51,560,000
PHI 1,905,354 $86,276,000
PIT 1,919,447 $102,953,333
SDP 2,138,491 $49,248,767
SEA 2,135,445 $172,438,700
SFG 3,303,652 $177,399,833
STL 3,448,337 $129,652,933
TBR 1,253,619 $79,473,033
TEX 2,507,760 $207,326,274
TOR 3,203,886 $158,890,575
;
proc plot;
Title "PayrollAW as a function of AttendanceAW";
plot PayrollAW*AttendanceAW;
run;




10 REPLIES 10
Jagadishkatam
Amethyst | Level 16

Please try the below code as an example

 

proc gplot data=sashelp.class;
plot height*weight;
run;
Thanks,
Jag
Allen799
Calcite | Level 5

thanks

Shmuel
Garnet | Level 18

You miss the informats of the numeric variables.

Try change your code to:

 

Data Homework4;
input Team $ AttendanceAW  comma14. PayrollAW  dollar14.;
Datalines;
   ... your data ...
; run;
Allen799
Calcite | Level 5

Thank you at least it gave me a plot chart.

 

Can you please explain the comma14. and dollar14. being used.

 

thanks 

Shmuel
Garnet | Level 18

@Allen799 wrote:

Thank you at least it gave me a plot chart.

 

Can you please explain the comma14. and dollar14. being used.

 

thanks 


Here is your original code with one data row:

 

Data Homework4;
input Team $ AttendanceAW PayrollAW;
Datalines;
ARI 2,134,375 $106,580,200

   use next code to check your result dataset. Be sure data was read correctly.

 

 

proc print data=homework4(obs=20); run; /* check first 20 data rows */

   you will get Team = 'ARI',  AttendanceAW = . ,  PayrollAW = . 

 

   thus because 2,134,375  is not numeric. By using the informat comma10. sas ignores the commas.
   10 defines the input variable value length, that is 10 characters. BY using comma14. sas expects at most 14 characters.
    

   similar to above, $106,580,200 is also not numeric. By using the informat dollar12. sas ignores the $ sign and the commas.

Reeza
Super User

Your data set is not being read in correctly for some reason. Are you actually reading in from data lines?

Please post the log with the actual error. 


@Allen799 wrote:

I am not getting an output. Receiving an error stating All values missing for plot of PayrollAW*AttendanceAW

 

I am brand new this so any advice you be appreciated. 

 

Data Homework4;
input Team $ AttendanceAW PayrollAW;
Datalines;
ARI 2,134,375 $106,580,200
ATL 2,505,252 $119,705,250
BAL 2,028,424 $161,621,633
BOS 2,917,678 $200,550,750
CHC 3,199,562 $177,210,667
CHW 1,629,470 $97,842,000
CIN 1,836,917 $79,315,786
CLE 2,048,138 $114,427,167
COL 2,953,650 $106,650,000
DET 2,321,599 $118,375,600
HOU 2,403,671 $157,656,400
KCR 2,220,370 $127,555,817
LAA 3,019,585 $181,125,500
LAD 3,765,856 $201,466,263
MIA 1,583,014 $111,591,100
MIL 2,627,705 $68,439,300
MIN 2,051,279 $103,932,500
NYM 2,460,622 $176,615,252
NYY 3,154,938 $182,424,700
OAK 1,475,721 $51,560,000
PHI 1,905,354 $86,276,000
PIT 1,919,447 $102,953,333
SDP 2,138,491 $49,248,767
SEA 2,135,445 $172,438,700
SFG 3,303,652 $177,399,833
STL 3,448,337 $129,652,933
TBR 1,253,619 $79,473,033
TEX 2,507,760 $207,326,274
TOR 3,203,886 $158,890,575
;
proc plot;
Title "PayrollAW as a function of AttendanceAW";
plot PayrollAW*AttendanceAW;
run;





 

Allen799
Calcite | Level 5

Title "Payroll_AW as a function of Attendance_AW";
36 plot Payroll_AW*Attendance_AW;
37 run;

ERROR: All values missing for plot of Payroll_AW * Attendance_AW. PLOT request will be ignored.

 

Not sure why its not recognizing datalines. I did use the comma14. and dollar14 that another person told me to do and it worked. But I am new to this and have not been taught the comma14 or dollar14 commands

KachiM
Rhodochrosite | Level 12

@Allen799 

 

Did you place the DOT (.) after the numeric like (comma14. and Dollar14.)?

Reeza
Super User

@Allen799 wrote:

Title "Payroll_AW as a function of Attendance_AW";
36 plot Payroll_AW*Attendance_AW;
37 run;

ERROR: All values missing for plot of Payroll_AW * Attendance_AW. PLOT request will be ignored.

 

Not sure why its not recognizing datalines. I did use the comma14. and dollar14 that another person told me to do and it worked. But I am new to this and have not been taught the comma14 or dollar14 commands


Check ALL your log. I'd be surprised to see your posted data step ran correctly and didn't generate a log full of warnings or errors.

KachiM
Rhodochrosite | Level 12

@Shmuel  has given the way to read the data.

 

Your next procedure may require more memory to plot your requirement. Hope you have that memory. Perhaps you may ask for some summary measures.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 10 replies
  • 1219 views
  • 0 likes
  • 5 in conversation