BookmarkSubscribeRSS Feed
ZainAbbas
Calcite | Level 5

Hi,

 

I have a list of respondents (in Excel) that have missing data for postcode, emails, student numbers to name a few demographics.

 

What code do I need to use in SAS in order to fill in these missing columns of data?

 

I have attached an example of the data I will be using/the columns of data that are missing and need filling in.

I am using SAS Enterprise Guide 7.1.

 

Help on this would be greatly appreciated!

 

Zain

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Import the data into SAS.

Write a datastep with som if statements to fill in the missing values.

 

Cannot provide anything further, you will need to help us by providing some things:

Test data in the form of a datastep - Excel is useless and dangerous.  Post a datastep with some test data, you can follow this post when its in SAS:
https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

Then from that test data show us what you would want out.

 

To import you have various options such as proc import.

To do ifs you can do something like:

data want;
  set have;
  if emails="" then emails="default text";
run;
SuryaKiran
Meteorite | Level 14

It depends how you want to fill those missing values. Do you have another table from where you want to do a look up and then fill the missing values?

 

Did you check UPDATE statement in Data step Update Statement in Data Step and also PROC SQL for updates Update Data using Proc SQL

 

Thanks,
Suryakiran

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 476 views
  • 0 likes
  • 3 in conversation