Can anyone tell me what is wrong here?
334 DATA Felibertiloop; set Felibertiloop;
335 array Symptoms[3] Symptoms1-Symptoms3;
336 **Output if all symptoms are missing;
337 IF max( of Symptoms(*)) = . then output;
338 ELSE DO I=1 to 3;
339 **Only output when sides are not missing;
340 Symptoms=Symptoms(i);
ERROR: Illegal reference to the array Symptoms.
341 IF not missing(Symptoms) then output;
ERROR: Illegal reference to the array Symptoms.
342 end;
343 drop i;
344 RUN;
Symptoms=Symptoms(i);
The left side of the assignment misses the necessary index for the array element.
Same happens in the next line.
Symptoms=Symptoms(i);
The left side of the assignment misses the necessary index for the array element.
Same happens in the next line.
Once you have an array named Symptoms, you can't use that name to represent anything else. In this case, you are trying to create a variable named Symptoms as well, which SAS finds illegal. Change the variable name to something else.
SAS is so fussy about reusing an array name that you would also get an error for this:
array symptoms {3} symptom1-symptom3;
array symptoms {3} symptom1-symptom3;
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.
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.