BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
David_Billa
Rhodochrosite | Level 12

Could you please help me to overcome the below NOTE in the log? Objective is to check for the string "BASECASE" in the variable SCENARIO_ID . If it not matches, then Output that record in the output

 

44         	FLT_ID=7;
45         	if SCENARIO_ID ne “BASECASE” then
46         		output;
47         run;

NOTE: Variable '“BASECASE”'n is uninitialized
1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

As @Tom pointed out in this thread, you should make sure to use the proper quotation marks and not the Windows Smart Quotes. 

 

See below

 

data have;
SCENARIO_ID="BASECASE";
run;

data want;
    set have;
    *if SCENARIO_ID ne “BASECASE” then output;
    if SCENARIO_ID ne "BASECASE" then output;
run;

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

As @Tom pointed out in this thread, you should make sure to use the proper quotation marks and not the Windows Smart Quotes. 

 

See below

 

data have;
SCENARIO_ID="BASECASE";
run;

data want;
    set have;
    *if SCENARIO_ID ne “BASECASE” then output;
    if SCENARIO_ID ne "BASECASE" then output;
run;
Kurt_Bremser
Super User

You committed the mistake of routing code through a word processor (somewhere in your development process) that replaced the correct double quotes with invalid "curly" ones.

This should work:

FLT_ID=7;
	if SCENARIO_ID ne "BASECASE" then
		output;
run;
AkilanR
Fluorite | Level 6

If you share full code will be helpful but some time if your dataset is not having set statement then your original dataset is destroyed and start over.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2079 views
  • 3 likes
  • 4 in conversation