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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1175 views
  • 3 likes
  • 4 in conversation