BookmarkSubscribeRSS Feed
jakarman
Barite | Level 11

Weel there must by a some weird character there. We cannot see it, but having two variables is telling there is a difference.

---->-- ja karman --<-----
anilgvdbm
Quartz | Level 8

see in the screen shot the last 2 variables BMI_Status and BMI_status... so don't know why it has repeated 2 time with gaps.

Keith
Obsidian | Level 7

Have you tried a different method to create your variable?  Storing the values in PROC FORMAT is generally better practice in these situations.  Try the code below, I'd be surprised if this causes the same error.

proc format;

value bmi_fmt   

low-16        =    'Severe thinness'

16-<17        =    'Moderate thinness'

17-<18.5    =    'Mild thinness'

18.5-<25    =    'Normal range'

25-<30        =    'Overweight'

30-<35        =    'Obese class I'

35-<40        =    'Obese class II'

40-high        =    'Obese class III';

run;

data nfhs_3.want;

set nfhs_3.BMI_women;

bmi = put(women_bmi, bmi_fmt.);

run;

Reeza
Super User

That view displays the variables labels not the variable names. post the output of a proc contents On your input and output datasets.

jakarman
Barite | Level 11

You have proved the variables are different. That is why you got the error and it did help to with using validvarname=all. 
The source code does have different names caused by a weird combination we do not see. Obviously you are using SAS-pc DMS V9 with a latin1 characterset.

This should not cause any issues of this kind. We cannot replay the error of copy/paste source code. Either you typed it or it did a correction.
The screenshot is hardly to see how the letters of the variables are. That is the interesting part is there something to see on the spelling of the variable. 

---->-- ja karman --<-----
Astounding
PROC Star

Given what you have described ...

Given what all the other posters have noticed ...

The simplest solution would be to remove these two lines from the program:

else if Women_BMI le 18.49  then  bmi="Mild thinness";

else if Women_BMI le 24.99  then  bmi="Normal range";

Then type them back in again.

You don't need to figure out what stray characters have managed to insert themselves into the code ... you only need to get rid of them.

Good luck.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 20 replies
  • 2451 views
  • 3 likes
  • 8 in conversation