BookmarkSubscribeRSS Feed
iressa13
Fluorite | Level 6

Hello everyone,

 

I am attempting to compute a new variable (BMI) with existing observations of weight and height. I have two questions.

 

1. how do I report BMI as "missing" if either the height or weight variables are missing for a subject?

2. I tried to calculate it but I don't know how to access the newly created data set that I believe is supposed to result of this command. 

 

Here is a photo of the code and log. Thank you for any help!

 

Screen Shot 2017-10-30 at 2.06.30 AM.pngScreen Shot 2017-10-30 at 2.16.45 AM.png

2 REPLIES 2
RahulG
Barite | Level 11

I think you should take this free course on SAS Programming 1: Essential 

 

https://support.sas.com/edu/schedules.html?ctry=us&crs=PROG1

 

 

Otherwise to your question, you can use If statment to handle BMI in case of missing values.

 

Go to Work library and find your output dataset. Or you can point your output dataset to PI library.

 

Kurt_Bremser
Super User

Code and logs are TEXT. Please post as such. Don't expect the people here to re-type from pictures.

Also supply example data. Use the macro from https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to convert your dataset P1.PROJECT1 to a data step, and post that according to https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce, so we can recreate your dataset for testing with copy/paste and submit.

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 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
  • 2 replies
  • 893 views
  • 0 likes
  • 3 in conversation