Hi,
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.
Perrine
What this note is telling you is that you have created a variable called gandbd1, however you have not in the datastep, assigned a value to any row.
That is what I do not understand because there are values. See the attached screenshot.
Thanks,
Perrine
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.
Here is my code:
data missingdata;
set surv.HPLanalysis_xlsx;
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);
run;
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.
Thanks
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:
https://communities.sas.com/t5/forums/replypage/board-id/sas_studio/message-id/2483
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;
Here is the code and log:
Ok, so:
Do a proc contents on surv.HPLanalysis_xlsx.
The screenshot of the proc content is in my first post.
@Perrine wrote:
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.
The proc content is with surv.HPLanalysis_xlsx.
The screenshot is the same as previously attached.
So finally I found it when I did a proc contents with missingdata. There was a space in my column in excel before GandBd1....
Thank you for all your answers!
Post the code and log. Without that, we can only make guesses.
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.
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.