BookmarkSubscribeRSS Feed
Perrine
Calcite | Level 5

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 

 


Screen Shot 2017-05-11 at 11.25.15 AM.png
13 REPLIES 13
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Perrine
Calcite | Level 5

That is what I do not understand because there are values. See the attached screenshot. 

Thanks, 

Perrine


Screen Shot 2017-05-11 at 11.52.31 AM.png
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Perrine
Calcite | Level 5

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 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;
Perrine
Calcite | Level 5

Here is the code and log:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
59
60 data missingdata;
61 set surv.HPLanalysis_xlsx;
62 if recall=3 then meantotveg=MEAN(Totvegd1,Totvegd1);
63 else if recall=2 then meantotveg=MEAN(Totvegd1);
64 if recall=3 then meantotGandB=MEAN(GandBd1,GandBd2);
65 else if recall=2 then meantotGandB=MEAN(GandBd1);
66 if recall=3 then meantotfruit=MEAN(Totfruitd1,Totfruitd2);
67 else if recall=2 then meantotfruit=MEAN(Totfruitd1);
68 run;
 
NOTE: Variable GandBd1 is uninitialized.
NOTE: Variable GandBd2 is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
42 at 64:31 8 at 65:36
NOTE: There were 80 observations read from the data set SURV.HPLANALYSIS_XLSX.
NOTE: The data set WORK.MISSINGDATA has 80 observations and 151 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 1348.65k
OS Memory 28328.00k
Timestamp 05/11/2017 04:12:02 PM
Step Count 112 Switch Count 66
Page Faults 0
Page Reclaims 439
Page Swaps 0
Voluntary Context Switches 215
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 520
 
 
69
70 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
82
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Ok, so:

NOTE: Variable GandBd1 is uninitialized.
NOTE: Variable GandBd2 is uninitialized
 
These do not exist in surv.HPLanalysis_xlsx;
At the time this dataset runs.  A picture of the contents after the event does not help, as after this note the variables do exist.  Run your code up to this step, don't run this step, stop before it.  Now check the contents of surv.HPLanalysis_xlsx;, you will see these variables do not exist.
Perrine
Calcite | Level 5

The screenshot of the proc content is in my first post.


Screen Shot 2017-05-11 at 11.25.15 AM.png
ballardw
Super User

@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.

Perrine
Calcite | Level 5

The proc content is with surv.HPLanalysis_xlsx.

The screenshot is the same as previously attached.

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
59
60 proc contents data=surv.HPLanalysis_xlsx;
61 RUN;
 
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.21 seconds
user cpu time 0.23 seconds
system cpu time 0.00 seconds
memory 3279.87k
OS Memory 29096.00k
Timestamp 05/11/2017 04:26:22 PM
Step Count 117 Switch Count 22
Page Faults 0
Page Reclaims 456
Page Swaps 0
Voluntary Context Switches 36
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 120
 
 
62
63 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
75
Perrine
Calcite | Level 5

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!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 1576 views
  • 0 likes
  • 4 in conversation