DATA Step, Macro, Functions and more

Cant find newly created dataset

Reply
Occasional Contributor
Posts: 12

Cant find newly created dataset

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

Super Contributor
Posts: 271

Re: Cant find newly created dataset

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.

 

Super User
Posts: 9,580

Re: Cant find newly created dataset

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 89 views
  • 0 likes
  • 3 in conversation