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

Please find the log attached

Reeza
Super User

 

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. 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 17 replies
  • 3375 views
  • 1 like
  • 5 in conversation