Help using Base SAS procedures

Error message: variable is uninitialized

Accepted Solution Solved
Reply
N/A
Posts: 1
Accepted Solution

Error message: variable is uninitialized

Hi Everyone,

I'm new to SAS and I'm having trouble fixing this error message: variable color is uninitialized. Some of the suggestions I have found elsewhere on how to fix this don't seem to apply (the original variable is in the dataset and I haven't misspelled anything). Any other ideas on how to fix this? Also, I'm trying to convert a character variable to a new numeric variable in this code.

Example:

data newdataset;

color2=.;

if color="black" then color2=1;

if color="red" then color2=2;

run;


Accepted Solutions
Solution
‎11-10-2013 10:12 AM
Super User
Super User
Posts: 6,498

Re: Error message: variable is uninitialized

You probably need to add a SET statement to bring in your original dataset that has the variable COLOR.

View solution in original post


All Replies
Solution
‎11-10-2013 10:12 AM
Super User
Super User
Posts: 6,498

Re: Error message: variable is uninitialized

You probably need to add a SET statement to bring in your original dataset that has the variable COLOR.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 494 views
  • 0 likes
  • 2 in conversation