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
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.
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.
Can you post a PROC CONTENTS of your input data set?
The data table from Proc Contents is attached.
That's PROC PRINT, Not PROC CONTENTS.
Oops. How's this?
Here's the data file.
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
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!
@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.
Rezza, Deleting that line of data fixed it! Many thanks!
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!
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.