05-11-2017 11:28 AM
I am getting that note for this variable and not for the rest of the variables even if I do a proc content this variable is listed (see attached).
I tried to change the name, the values and I keep on getting that note and cannot do anything with this variable.
Does anybody know why?
Thank you for your help.
05-11-2017 11:59 AM
And are they assigned in the same datastep as the variable is defined? That is what the note is telling you. For instance, I can get the same note with:
data want; length b $10; run;
I create a variable called b, but in that dataste I assign no values to it.
05-11-2017 12:04 PM
Here is my code:
if recall=3 then meantotveg=MEAN(Totvegd1,Totvegd1);
else if recall=2 then meantotveg=MEAN(Totvegd1);
if recall=3 then meantotGandB=MEAN(GandBd1,GandBd2);
else if recall=2 then meantotGandB=MEAN(GandBd1);
if recall=3 then meantotfruit=MEAN(Totfruitd1,Totfruitd2);
else if recall=2 then meantotfruit=MEAN(Totfruitd1);
It works for the other variables but just not for GandBd1 and GandBd2.
They are all from an excel that has similar variables in it.
05-11-2017 12:11 PM
Yes, that doesn't help me. Please post the dataset: set surv.HPLanalysis_xlsx;, as a datastep (just a few rows is fine) as text here. You can follow this post:
Also please , post the log of the part where this occurs, does the note follow this specific datastep, if so then the two given variables are not in that dataset and are getting create in this datastep, as as they are used in a condition never get assigned a value e.g to replicate:
data have; Totvegd1=12; output; Totvegd2=1; output; run; /* Note above does not contain gbandbd1 */ data want; set have; result1=mean(totvegd1,totvegd2); result2=mean(gbandbd1,totvegd1); run;
05-11-2017 12:14 PM
Here is the code and log:
05-11-2017 12:18 PM
05-11-2017 12:11 PM
Do a proc contents on surv.HPLanalysis_xlsx.
05-11-2017 12:24 PM
The screenshot of the proc content is in my first post.
And WHICH data set did you run that on? Missingdata or surv.HPLanalysis_xlsx? Yes the variables would be present in Missingdata as you just created them by referencing the variable name. The calculated values are missing because they use variables that are not in surv.HPLanalysis_xlsx.
Run Proc contents on surv.HPLanalysis_xlsx and show the complete result.
05-11-2017 12:28 PM
The proc content is with surv.HPLanalysis_xlsx.
The screenshot is the same as previously attached.
05-11-2017 12:08 PM
Post the code and log. Without that, we can only make guesses.