Getting Started with SAS Programming by Ron Cody
Author:Ron Cody [Ron Cody]
Language: eng
Format: epub, pdf
Publisher: SAS Institute
Published: 2021-02-24T00:00:00+00:00
The program worked as advertised.
Extracting the Day of the Week, Day of the Month, Month, and Year from a SAS Date
You can use the four functions, WEEKDAY, DAY, MONTH and YEAR, to compute the day of the week (a number from 1 to 7, with 1=Sunday), day of the month (a number from 1 to 31), month of the year (a number from 1 to 12), and year from a SAS date. Letâs look at an example.
You have a SAS data set with a variable called Date. You would like to generate bar charts showing frequencies for day of the week, day of the month, and year.
To save room, this program only produces a bar chart for the day of the week. You can substitute the day of the month or year to obtain bar charts for these variables. The DATA step that creates the data set containing the Date variable is included so that you can try running the program yourself.
Program 13.4: Extracting the Day of the Week, Day of the Month, and Year from a SAS Date
data Extract;
informat Date mmddyy10.;
input Date @@; ïµ
Day_of_Week = weekday(Date); ï¶
Day_of_Month = day(Date);
Year = year(Date);
format Date mmddyyd10.;
datalines;
1/5/2000 2/8/2000 4/23/2000 4/12/2000 8/21/2000 8/21/2000 8/22/2000
12/12/2000 12/15/2000 12/18/2000
2/22/2001 2/1/2001 4/18/2001 4/18/2001 4/18/2001 9/17/2001 12/25/2001
12/22/2001 3/3/2001 3/6/2001 3/7/2001
;
title âListing of the First Eight Observations from Extractâ;
proc print data=Extract (obs=8); ï·
run;
Download
Getting Started with SAS Programming by Ron Cody.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7808)
Grails in Action by Glen Smith Peter Ledbrook(7719)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6811)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6809)
Running Windows Containers on AWS by Marcio Morales(6328)
Kotlin in Action by Dmitry Jemerov(5089)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(5053)
Combating Crime on the Dark Web by Nearchos Nearchou(4626)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4579)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4437)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(4316)
The Age of Surveillance Capitalism by Shoshana Zuboff(3977)
Python for Security and Networking - Third Edition by José Manuel Ortega(3878)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3536)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3528)
Learn Wireshark by Lisa Bock(3496)
Mastering Python for Networking and Security by José Manuel Ortega(3376)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3353)
Blockchain Basics by Daniel Drescher(3322)
