Thursday, July 21, 2011

Wednesday, July 6, 2011

How to create a SAS date from "YYYY-MM-DD HH:MM:SS"

Problem
How to pull a SAS date from a text field formatted as YYYY-MM-DD HH:MM:SS.

Solution
data myTable;
set myTable;
informat dateVar date9.;
format dateVar date9.;
dateVar = input(substr(temp_dt,1,10), yymmdd10.);
run;

Friday, June 10, 2011

SAS Macro to Import Tab-Delimited Files into SAS


/***********************************************************
IMPORT TAB-DELIMITED text files into SAS
June 10, 2011
http://sastipsbyhal.blogspot.com/
*/
%LET file1 = myFirstFile.txt;
%LET file2 = mySecondFile.txt;
%LET file3 = myThirdFile.txt;
%LET file4 = myFourthFile.txt;
%LET file5 = myFifthFile.txt;
%LET file6 = mySixthFile.txt;
%LET file7 = mySeventhFile.txt;
%LET file8 = myEighthFile.txt;
%LET fileName1 = sasNameFor_myFirstFile;
%LET fileName2 = sasNameFor_mySecondFile;
%LET fileName3 = sasNameFor_myThirdFile;
%LET fileName4 = sasNameFor_myFourthFile;
%LET fileName5 = sasNameFor_myFifthFile;
%LET fileName6 = sasNameFor_MySixthFile;
%LET fileName7 = sasNameFor_mySeventhFile;
%LET fileName8 = sasNameFor_myEighthFile;
%LET fileLoc = \\folder\where\txt\files\are\located\;
%LET fileMax = 8;
%MACRO tabdIMPORT;
%Do i = 1 %to &fileMax. ;
PROC IMPORT OUT=WORK.&&fileName&i 
            DATAFILE= "&fileLoc&&file&i"
            DBMS=TAB REPLACE;
    GETNAMES=YES;
    DATAROW=2; 
RUN;
%END;
%MEND;
%tabdIMPORT;

Saturday, January 1, 2011

Blogger Custom Domain DNS

How do you configure a DNS record for a Blogger-hosted blog using a custom domain? The below DNS configurations power this blog with HTTPS enabled. The screenshot comes from the domain registrar Namecheap. The boxed out sections are blog-specific alphanumeric strings that you can get following Google's Blogger instructions to Set up a custom domain: