This file contains 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
/* | |
%SURVEYGENMOD macro copied from https://support.sas.com/resources/papers/proceedings17/0268-2017.pdf | |
%SURVEYGENMOD Macro: An Alternative to Deal with Complex Survey Design for the GENMOD Procedure | |
Alan Ricardo da Silva, Universidade de Brasilia, Dep. de Estatística, Brazil | |
Original PDF was not conducive for copy/paste, so this version attempts to correct | |
for many end-of-line wrapping problems. Might not have caught them all! | |
*/ | |
%macro surveygenmod(data=, y=, x=, offset=, weight=, | |
strata=, cluster=, domain=,fpc=, dist=normal, | |
link=identity, xzip=, intercept=y, scale=deviance, |
This file contains 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 is viagra, from the example on https://mor.nlm.nih.gov/download/rxnav/RxNormAPIs.html# */ | |
%let rxcui = 213269; | |
/* | |
Or try acetaminophen with this code | |
%let rxcui = 209468; | |
*/ | |
/* allocate a file for the response */ | |
filename rx temp; |
This file contains 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
/* | |
Described in the blog post: | |
The Internet of Snacks: SnackBot data and what it reveals about SAS life | |
https://blogs.sas.com/content/sasdummy/snackbot-api-timeseries/ | |
by Chris Hemedinger | |
*/ | |
/* Use these ODS statements in SAS for Windows or SAS Enterprise Guide */ | |
ods _all_ close; | |
filename results "%sysfunc(getoption(WORK))/snackbot.htm"; | |
ods html5 file=results style=Htmlencore gtitle options(svg_mode="inline"); |
This file contains 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
/* Which RNG did Thanos use? */ | |
/* https://blogs.sas.com/content/sasdummy/rng-avengers-thanos/ */ | |
/* Using STREAMINIT with the new RNG algorithm argument */ | |
%let algorithm = PCG; | |
data characters; | |
call streaminit("&algorithm.",2018); | |
infile datalines dsd; | |
retain x 0 y 1; | |
length Name $ 60 spared 8 x 8 y 8; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
/* Produce a list of ZIP files and their entries from a single folder */ | |
%macro listzipcontents ( | |
targdir= /* a system folder that contains ZIP files */, | |
outlist= /* output data set for list of files and members */); | |
filename targdir "&targdir"; | |
/* Gather all ZIP files in a given folder */ | |
/* Searches just one folder, not subfolders */ | |
/* for a fancier example see */ | |
/* http://support.sas.com/kb/45/805.html (Full Code tab) */ |
This file contains 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 listzipcontents (targdir=, outlist=); | |
filename targdir "&targdir"; | |
/* Gather all ZIP files in a given folder */ | |
/* Searches just one folder, not subfolders */ | |
/* for a fancier example see */ | |
/* http://support.sas.com/kb/45/805.html (Full Code tab) */ | |
data _zipfiles; | |
length fid 8; | |
fid=dopen('targdir'); |
This file contains 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
/* Example to read CSV file from the web */ | |
/* Import to SAS with nonstandard var names */ | |
/* Then rename/relabel to conform with standard */ | |
/* SAS variable name rules */ | |
/* Fetch the file from the web site */ | |
filename probly temp; | |
proc http | |
url="https://raw.githubusercontent.com/zonination/perceptions/master/probly.csv" | |
method="GET" |
This file contains 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
/* Copyright 2017 SAS Institute */ | |
/* Author: Chris Hemedinger */ | |
/* http://blogs.sas.com/content/sasdummy/using-sas-to-access-google-analytics-apis/ */ | |
/* PREREQUISITES */ | |
/* Use the Google Developer console to define a project */ | |
/* and application, and generate a client-id and client-secret token */ | |
/* Of course, you'll need access to a Google Analytics account with at */ | |
/* least one view profile that allows access to metrics and dimensions. */ | |
/* STEP 1. Need to perform just once in a BROWSER. */ |
This file contains 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
/* Fetch the repositories and stats from an */ | |
/* organization's account on GitHub */ | |
/* Requires SAS 9.4 Maint 4 */ | |
/* by Chris Hemedinger */ | |
/* Copyright 2017 SAS Institute Inc. */ | |
/* Change this value to the account you want to report on */ | |
/* Some fun accounts: netflix, spotify, apache */ | |
%let account=sassoftware; | |
%let acct_type=orgs; |
NewerOlder