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
# SasMetadataGetColumns.ps1 | |
# Example usage: | |
# For table grid display, use: | |
# .\SasMetadataGetColumns.ps1 | Out-Gridview | |
# For export to CSV | |
# .\SasMetadataGetColumns.ps1 | Export-Csv -Path "c:\output\cols.csv" -NoTypeInformation | |
# ------------------------------------------------------------------- | |
# create the Integration Technologies objects | |
$objFactory = New-Object -ComObject SASObjectManager.ObjectFactoryMulti2 | |
$objServerDef = New-Object -ComObject SASObjectManager.ServerDef |
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 SAS program uses the ARRPI translator at: | |
http://isithackday.com/arrpi.php | |
To translate whatever English text you supply into | |
Pirate speak for Talk Like a Pirate Day | |
*/ | |
%let text = %sysfunc(urlencode('Hello, SAS users are the best')); | |
filename resp TEMP; | |
proc http |
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; |
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
%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
/* http://prismjs.com/download.html?themes=prism&languages=sas */ | |
/** | |
* prism.js default theme for JavaScript, CSS and HTML | |
* Based on dabblet (http://dabblet.com) | |
* @author Lea Verou | |
*/ | |
/* for Lithium messages */ | |
/* a very specific style override for SAS language in a PRE tag */ | |
#lia-body .lia-content .lia-message-body pre.language-sas, |
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
Prism.languages.sas = { | |
'datalines': { | |
/* fixed datalines pattern to include datalines4 and possible whitespace before terminating ; */ | |
pattern: /(^|[\r\n])\s*(?:(?:data)?lines|cards|datalines4);[\s\S]+?[\r\n](\s)*;/i, | |
lookbehind: true, | |
inside: { | |
'keyword': { | |
pattern: /^(\s*)(?:(?:data)?lines|cards|datalines4)/i, | |
lookbehind: true | |
}, |
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
/* Your zip file folder location */ | |
%let projectDir = c:\temp; | |
/* macro to assign a fileref to a SAS data set in a Base library */ | |
%macro assignFilerefToDataset(_dataset_name); | |
%local outDsName; | |
ods output EngineHost=File; | |
proc contents data=&_dataset_name.; | |
run; | |
proc sql noprint; | |
select cValue1 into: outDsName |
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 code publish to Slack channel */ | |
/* Author: Chris Hemedinger */ | |
/* See explanation at: */ | |
/* http://blogs.sas.com/content/sasdummy/slack-channel-with-sas/ */ | |
%macro echoResp(fn=); | |
data _null_; | |
infile &fn; | |
input; |