Please find the log attached
284 */ changing inches to cms*/; 285 data demo2; 286 set mergedemo; 287 If comor_9hgtunit_decode then do; 288 height_cm = comor_9hgt/2.54; 289 end; 290 else do; 291 height_cm =comor_9hgt; 292 end; 293 run; NOTE: Character values have been converted to numericvalues at the places given by: (Line):(Column).287:4 NOTE: Invalid numeric data, comor_9hgtunit_decode='cm' , atline 287 column 4.
See how the log indicates where the error is?
It says Line 287:4, which happens to be this comor_9hgtunit_decode
Your code is incorrect, it should be checking against a value as I indicated earlier. I believe you're trying to convert inches to cm so check if the value is inches.
If comor_9hgtunit_decode = 'inches' then do;
@heatherjae15 wrote:
Please find the log attached
Also, when you paste the log into a document not everyone can view it - I can't if I'm at work for example. Additionally, when I copied and pasted it back here I had to reformat it. So in the future please, paste only the code and log that has the errors starting from the first error and paste the log directly into the forum, similar to how I did for my response. Use the 6th icon in the editor to insert the log. This makes it much easier and faster to answer your question and our computer don't get clogged with downloads.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: