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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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