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

I created a new variable (gdp_change) and it is not showing up in the work library. 

data gdp_trumbull_mahoning;
set hp.final_gdp4;
format gdp2018 gdp2019 gdp_change_2018_2019 comma10.2;
keep naics ecnty fips county state gdp2018 gdp2019;
where (state = "OH") and county in ("Trumbull", "Mahoning"); 
gdp_change_2018_2019 = gdp2019 - gdp2018;
*putlog _all_;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
It's not in your KEEP statement so the data step doesn't keep the variable at the end. Add the variable to your KEEP statement.

View solution in original post

2 REPLIES 2
Reeza
Super User
It's not in your KEEP statement so the data step doesn't keep the variable at the end. Add the variable to your KEEP statement.
IrynaDemko
Calcite | Level 5

Good catch!

Thank you!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2099 views
  • 3 likes
  • 2 in conversation