BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ballardw
Super User

@AbhilashS wrote:

Hi Ballardw

Thank you for pointing this out. This is actually a self-guided statistics course with this data specifically being generated from the CDC website. There is no live instructor but I will try and email your points to the course creator. It has been a challenge as the tutorials do not anticipate problems like the one I have had so I am quite thankful to the help I am getting. 


CDC explains entirely too much. I've worked with a number of there systems over the years and as soon as they went away from fixed column data formats for text things fell apart. I have one project involving them where the data down load involves about 60 CSV files. The "program" they provided to to read the data starts with a macro to open all the CSV files and save them as XLSX files and then use Proc Import to read those. I started to write code to read the CSV and ran into the exact same issue of numeric values in quotes and it isn't always easy to tell which variables that contain all-numeral values are supposed to be numeric or are actually text ID codes.

kristinsainani
Calcite | Level 5

A simple trick to change this variable to numeric is to add 0 to the variable (and name it something new):

data NEW;

set OLD;

rate2=age_adjusted_rate+0;

run;

Reeza
Super User

@kristinsainani wrote:

A simple trick to change this variable to numeric is to add 0 to the variable (and name it something new):

data NEW;

set OLD;

rate2=age_adjusted_rate+0;

run;


This does work, but it's not recommended. It will generate a warning in the log about implicit conversion, so you're now used to seeing the messages in your log which makes it easier to miss other issues or to have them suppressed because you have too many notes/warnings.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 17 replies
  • 3509 views
  • 5 likes
  • 6 in conversation