How do I find missing demographics in SAS from an Excel Spreadsheet

Reply
New User
Posts: 1

How do I find missing demographics in SAS from an Excel Spreadsheet

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

Super User
Super User
Posts: 9,023

Re: How do I find missing demographics in SAS from an Excel Spreadsheet

Posted in reply to ZainAbbas

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;
Super Contributor
Posts: 405

Re: How do I find missing demographics in SAS from an Excel Spreadsheet

Posted in reply to ZainAbbas

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
Ask a Question
Discussion stats
  • 2 replies
  • 55 views
  • 0 likes
  • 3 in conversation