I defined an IML module named FFSS_CLASSIFY. It originally had much more code than shown below, but I removed everything except the start/finish framework and the reset, load module, and store module environment to simplify my question. The question is: why am I getting the error "ERROR: A required argument is missing in the call to function FFSS_CLASSIFY."? The code below does not generate any errors, but neither does it do anything useful. Once I start to uncomment the parameters, errors show up and I cannot understand why. If I uncomment the reset, load, or store statements, errors show up. Please tell me that there is an easy solution so that I can watch my fingers dance on the keyboard once again.
TYVM, Ross
proc iml ;
/* reset storage=featclus.featclus ; */
/* load module=_all_ ; */
start ffss_classify( data
/* , m */
/* , p */
/* , dsn_ideals */
/* , dsn_out */
/* , names_in */
) ;
/* empty function body */
return results ;
finish ffss_classify ;
/* store module=ffss_classify ; */
quit ;
Try to provide a reproducible example that we can run on our system.
That error message would appear if you call a function incorrectly. For example, if you try to call it without the first argument, you will get that error:
y = ffss_classify(); /* ERROR: A required argument is missing.... */
So look at the code where the function is CALLED, and make sure you include the correct number of input arguments.
Rick,
I have attached two SAS programs, each one defining a SAS/IML module. The first one has 5 parameters and has no errors--it is merely the empty body of the module. The second one has 6 parameters and one error: the "required argument is missing". But the second module is not invoked! so I am at a loss to understand why there is any interpretation error. Does SAS/IML check modules for compatibility prior to invocation? If not, why the error? Also, If I remove a module from a SAS/IML catalog (remove=ffss_classify) and then define it again, was any trace of the old module left behind to in some way influence the definition of a new module with the same name?
For your lectorial convenience, here are the modules as embedded code in this question:
options nonotes ;
proc iml ;
reset storage=featclus.featclus ;
load module=_all_ ;
start ffss_classify( data /* matrix containing feature population, class variable */
, m /* power parameter m for generalized mean */
, p /* power parameter p for Minkowski distance function */
, dsn_out /* output dataset of feature data, actual and pred class values */
, names_in /* names of features + class_label in data matrix */
) ;
return results ;
finish ffss_classify ;
store module=ffss_classify ;
quit ;
---------------------------------------------------------------------------------------------------
69 options nonotes ;
70
71 proc iml ;
72 reset storage=featclus.featclus ;
73 load module=_all_ ;
ERROR: Too many arguments for function FFSS_CLASSIFY.
74
75 start ffss_classify( data /* matrix containing feature population, class variable */
76 , m /* power parameter m for generalized mean */
77 , p /* power parameter p for distance function */
78 , dsn_ideals /* input dataset containing ideal vectors */
79 , dsn_out /* output dataset of feature data, actual and pred class values */
80 , names_in /* names of features + class_label in data matrix */
81 ) ;
174
175 return results ;
176 finish ffss_classify ;
177
178 /* store module=ffss_classify ; */
179 quit ;
Try to provide a reproducible example that we can run on our system.
You wrote: "My suspicion is that the one of the stored modules is calling ffss_classify with the old syntax. But that error should only appear if the ffss_classify is called or if a second function that calls ffss_classify is being stored."
I checked all of my modules and found one that called FFSS_CLASSIFY with 5 parameters and not 6. I updated it and tried to run my code suite again. Then I said to myself, "No more Mr. Nice Guy. It's time for a cold boot" and I ran all of my modules again to update all of them in the catalog. Voila! Things began to work properly again. So I am moving forward. Thank you so much! Ross
Update to previous message:
I changed the name of the IML catalog to featclus.featclus_new from featclus.featclus and submitted the code below. Mirabile dictu! Here is the log of the interpreted modules:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 options nonotes nosymbolgen ;
70
71 options nonotes ;
72
73 proc iml ;
74 reset storage=featclus.featclus_test ;
75 load module=_all_ ;
76
77 start ffss_classify( data /* matrix containing feature population, class variable */
78 , m /* power parameter m for generalized mean */
79 , p /* power parameter p for Minkowski distance function */
80 , dsn_out /* output dataset of feature data, actual and pred class values */
81 , names_in /* names of features + class_label in data matrix */
82 ) ;
83
84 return results ;
85 finish ffss_classify ;
86
87 store module=ffss_classify ;
88 quit ;
89
90 proc iml ;
91 reset storage=featclus.featclus_test ;
92 load module=_all_ ;
93
94 start ffss_classify( data /* matrix containing feature population, class variable */
95 , m /* power parameter m for generalized mean */
96 , p /* power parameter p for distance function */
97 , dsn_ideals /* input dataset containing ideal vectors */
98 , dsn_out /* output dataset of feature data, actual and pred class values */
99 , names_in /* names of features + class_label in data matrix */
100 ) ;
101 return results ;
102 finish ffss_classify ;
103
104 /* store module=ffss_classify ; */
105 quit ;
106
107
108 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
118
So if all that I did was to cause the modules to be stored in a new catalog, does that action suggest that there is something wrong in the IML function that updates modules? I tried "remove module=ffss_classify" before defining the 6-parameter module, but to no avail. Please tell me where I have gone wrong. This error has never happened to me before. Thanks, Ross
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!