This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 2019-09-20 | |
| library(lubridate) | |
| term_start = as.Date("2012-01-01", "%Y-%m-%d") | |
| term_end = term_start + years(5) - days(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##This program illustrates how to find duplicates in your data set for a particular key | |
| ##All duplicate records will be indentified | |
| mtcars %>% | |
| group_by(carb) %>% | |
| filter(n()>1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *This illustrates how to create a datetime stamp in the format of YYYYMMDDHHMM; | |
| %let fileTimeStamp = %sysfunc(date(), yymmddn8.)%sysfunc(putc(%sysfunc(time(), b8601TM6.), $4.)) ; | |
| %put &fileTimeStamp.; | |
| *Results from log; | |
| * 71 %let fileTime = %sysfunc(date(), yymmddn8.)%sysfunc(putc(%sysfunc(time(), b8601TM6.), $4.)) ; | |
| * 72 %put &fileTime.; | |
| * 201907310938; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| install.packages("cansim") | |
| install.packages("tidyverse") | |
| library("cansim") | |
| library("tidyverse") | |
| pop <- get_cansim("17-10-0005-01") | |
| #keep only relevant data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*This program illustrates how to build a daily process that will add in your data and then create an automatic report every day | |
| Author: F. Khurshed | |
| Date: 2019-06-18 | |
| */ | |
| data have; | |
| input ID : 4. bucket1-bucket3 : 5.2; | |
| format bucket: 5.2; | |
| datalines; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Original Source: https://support.sas.com/kb/25/024.html | |
| */ | |
| %macro vartest(version, | |
| data= _last_ , | |
| var= , | |
| alpha= 0.05 , | |
| var0=, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %macro importStatCan(tableNum = , dset= ); | |
| filename out "%sysfunc(getoption(work))/&tableNum.-eng.zip"; | |
| proc http | |
| url="https://www150.statcan.gc.ca/n1/tbl/csv/&tableNum.-eng.zip" | |
| method="get" | |
| out=out; | |
| run; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proc sql; | |
| create table master_process_time | |
| (Entry char(32), | |
| StartTime num format=datetime22.4, | |
| EndTime num format=datetime22.4, | |
| duration num format=32.4, | |
| recordTime num format=datetime22.4); | |
| quit; | |
| %global startTime endTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://d13ot9o61jdzpp.cloudfront.net/files/Excel%204.0%20Macro%20Functions%20Reference.pdf | |