Content from Data.xlsx file PatientID First Name Last Name PATO01 Emily Harris PATO02 Emily Lee PAT003 Clark PATO04 Jane Brown PATO05 Emily Smith PATO06 Michael Smith Michael Gender DOB Female Female Male Male Male Male 1/9/82 1/10/67 1/8/59 1/7/80 1/3/63 1/9/65 Admission Date 11/15/22 7/12/23 6/30/23 3/22/23 5/4/23 7/7/23 Length OfStay 20 45 3 9 22 7 BaseCharge 521.98 544.13 430.21 445.09 910.19 695.5 DiscountRate 0.27 0.03 0.46 0.13 0.18 0.35

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 4.3CP
icon
Related questions
Question
Content from Data.xlsx file
PatientID First Name LastName Gender DOB
PATO01 Emily
Harris
Female
PATO02 Emily
Lee
Female
PATO03
Michael
Clark
Male
PATO04
Jane
Male
PATO05 Emily
Male
PAT006
Male
Brown
Smith
Michael Smith
1/9/82
1/10/67
1/8/59
1/7/80
1/3/63
1/9/65
Admission Date
11/15/22
7/12/23
6/30/23
3/22/23
5/4/23
7/7/23
Length OfStay
20
45
3
9
22
7
BaseCharge
521.98
544.13
430.21
445.09
910.19
695.5
DiscountRate
0.27
0.03
0.46
0.13
0.18
0.35
Transcribed Image Text:Content from Data.xlsx file PatientID First Name LastName Gender DOB PATO01 Emily Harris Female PATO02 Emily Lee Female PATO03 Michael Clark Male PATO04 Jane Male PATO05 Emily Male PAT006 Male Brown Smith Michael Smith 1/9/82 1/10/67 1/8/59 1/7/80 1/3/63 1/9/65 Admission Date 11/15/22 7/12/23 6/30/23 3/22/23 5/4/23 7/7/23 Length OfStay 20 45 3 9 22 7 BaseCharge 521.98 544.13 430.21 445.09 910.19 695.5 DiscountRate 0.27 0.03 0.46 0.13 0.18 0.35
Write SAS code for the following task:
1) Read in the excel file "Data.xlsx" to create a temporary SAS dataset
2) Based on the DOB column, create a new column called Age
3) Based on Admission Date and LengthOfStay, create a new column called DischargeDate
4) Based on BaseCharge and DiscountRate, create a new column called DiscountAmount
5) Based on DiscountAmount and BaseCharge, create a new column called TotalCharge
6) Remove the LengthOfStay and DiscountRate columns and ensure all columns, including
the original and new, are in the correct format to represent the data, i.e., date, money
7) Checking the data type and displaying the final data table with PROC CONTENTS and
PROC PRINT
8) The final dataset should be exported as a csv file named "Output Data.csv"
Transcribed Image Text:Write SAS code for the following task: 1) Read in the excel file "Data.xlsx" to create a temporary SAS dataset 2) Based on the DOB column, create a new column called Age 3) Based on Admission Date and LengthOfStay, create a new column called DischargeDate 4) Based on BaseCharge and DiscountRate, create a new column called DiscountAmount 5) Based on DiscountAmount and BaseCharge, create a new column called TotalCharge 6) Remove the LengthOfStay and DiscountRate columns and ensure all columns, including the original and new, are in the correct format to represent the data, i.e., date, money 7) Checking the data type and displaying the final data table with PROC CONTENTS and PROC PRINT 8) The final dataset should be exported as a csv file named "Output Data.csv"
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage