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
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;
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;
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;
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.