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!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 2278 views
  • 3 likes
  • 2 in conversation