Exporting data

4 minutes
Share the link to this page
Copied
  Completed

Transcript

Welcome to clinical data management program using SAS. In this video we will be discussing about how do we export data that is how do we export SAS data set into our audit file, we'll be doing two parts of exporting data One is we will be exporting it in form of a notepad file. We'll export it to a regretful and others will export it to a CSV file. So let's start it. proc export data equals CDM dot we're using this data set called diabetics. So this data set consists of encounter ID, patient number, race, gender, age, weight, admission type discharge disposition, Id then admissions officer ID time in hospital pair code, medical specialty number of lab procedures, number of medications number of outpatient number of emergency number of inpatient and this is one two, this is two this is three number of diagnoses maximum blue serum a one resolvement coffin rubber Linnaeus natively named chloroform moment eliminate acidotic Semite and so on.

We have got number of variables and we have approx one lakh 1766 observations so we'll be doing proc export data equal to CDM dot will be giving the dataset name is diabetics is my latest name next we'll do outfight equals will give the path a VM to export so I want exported over here let's give the path we'll take the path from here we'll copy the path slash will give the name by which it's going to be exported that is after first we are exporting to a notepad file. So after we exported to an IT notepad file, what will be its name we are giving the name is diabetics three dot txt then we read DBMS equals tab the database management system is equals to tap tap why because it will be tab separated then replace mines as it as it is getting replaced by the raw data file and then run.

Let's run this code from proc export till replaces one sending a one statement therefore opposite diabetes we do not give any same column. Now let's run this code. So let's open this mp3 dot txt data set. So it's a text file or notepad file. Since it's a huge credit it's going to take time to open that's why it's buffering now. So this is the notepad file that we have got.

See after we have exported the data, the SAS data set or txt file, this looks like this. This is my diabetics fate. Okay, now the same thing we are going to do We will be able to again export the diabetes data to a CSV file, exported diabetics data or any other data set but now we have to learn how to export a SAS data set to a CSV file. So we are going to use the D two data set that is which consists of ID gender, date of birth zip code, province status, education, marital status, children ancestry, average commute daily interent use of level vehicles, military service disease and C one. So we'll be exporting this to an CSV file. So we'll be using the same procedure proc export data.

You can use any SAS data set you want CDM dot d do outfight equals within double quotes and then the path will give it give the name say we give d 21 dot CSV then DBMS database management system with BCS See this comma separated value file, then replace and then run. Now let's run this code let's open the CSV file to this is my D 21 dot CSV file. So this is the CSV file consisting of ID gender, DOB zip code of government status education marital status, children ancestry, average commute date interviews available number of vehicles, military services diseases NC one. So this is how you export your SAS data set to a new path file or a CSV file. In this video we'll be doing till here in my upcoming video, I'll be discussing about the concept of the different statistical concepts like descriptive statistics inferential statistics, and Thank you Goodbye.

See you on the next week. You

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.