BookmarkSubscribeRSS Feed
hbartjr
Calcite | Level 5

I'm encountering an execution error when analyzing some seasoned SAS code for something called "Sheared Principal Components Analysis" on fish proportional measurements.  The error statement reads "ERROR: (execution) Invalid argument or operand; contains missing values" and references line 136 in my code (I think), which reads: "Q = (X`*X - C`*C*NIND)/(NIND-{1}); ".  I've successfully run this code hundreds of times in SAS University Edition and earlier versions of SAS.  I'm attaching the code and the dataset I'm using in case this sounds like something someone can help me with. Many thanks, Hank 

12 REPLIES 12
ballardw
Super User

Run Proc contents on your imported data set. It is very likely that due to the nature of Excel files that a variable that was previously numeric is character this time or possibly the names of the variables changed. Either might result in missing values for the variables.

 

Look at the variable type for the variables mention on that referenced line 136 of code: X C NIND.

hbartjr
Calcite | Level 5

The variables you mention are defined in "MAIN" code. NIND = number of individuals (43) and C = grand centroid. I imported the data set and all data points are numeric in output.  

Reeza
Super User

Can you post a PROC CONTENTS of your input data set?

 

hbartjr
Calcite | Level 5

The data table from Proc Contents is attached.

Reeza
Super User

That's PROC PRINT, Not PROC CONTENTS.

hbartjr
Calcite | Level 5

Oops.  How's this?  

Reeza
Super User
And you didn't include the data set so we can't run your code either.
hbartjr
Calcite | Level 5

Here's the data file.

Reeza
Super User

Your original error

ERROR: (execution) Invalid argument or operand; contains missing values

 

Row 13, DoFL value is missing in the Excel file. It runs fine once you fix the data to not have missing values.

 


@hbartjr wrote:

I'm encountering an execution error when analyzing some seasoned SAS code for something called "Sheared Principal Components Analysis" on fish proportional measurements.  The error statement reads "ERROR: (execution) Invalid argument or operand; contains missing values" and references line 136 in my code (I think), which reads: "Q = (X`*X - C`*C*NIND)/(NIND-{1}); ".  I've successfully run this code hundreds of times in SAS University Edition and earlier versions of SAS.  I'm attaching the code and the dataset I'm using in case this sounds like something someone can help me with. Many thanks, Hank 


 

hbartjr
Calcite | Level 5

Row 13 of DoFL is assigned a "." (period) value in the results table (attached), which I thought meant missing value, and would be skipped.  Does SAS no longer work this way?  I could delete the entire row and see if that fixes it.  I've got to run, so it'll be a while before I can respond to any more posts.  Thanks!  

Reeza
Super User

@hbartjr wrote:

Row 13 of DoFL is assigned a "." (period) value in the results table (attached), which I thought meant missing value, and would be skipped.  Does SAS no longer work this way?  I could delete the entire row and see if that fixes it.  I've got to run, so it'll be a while before I can respond to any more posts.  Thanks!  


It does in data steps, not in PROC IML. Matrices math can't handle missing values in this case. 

 

hbartjr
Calcite | Level 5

Rezza, Deleting that line of data fixed it!  Many thanks!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 12 replies
  • 1570 views
  • 0 likes
  • 3 in conversation