BookmarkSubscribeRSS Feed
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

Barite | Level 11

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



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.


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 to convert your dataset P1.PROJECT1 to a data step, and post that according to, so we can recreate your dataset for testing with copy/paste and submit.


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
  • 3 in conversation