David Franklin, Blog, Archive
2016 Archive
Back dfranklinnh@gmail.com

 

Blog (known originally as the SAS Tip of the Month)

2019
January - tabs to spaces using the vi editor
February - MSGLEVEL and the MERGE statment
March - _freq_ vs n, what is the difference?
April - OPTIONS SOURCE2
May - %put macro_variable
June - FLOWOVER and MISSOVER and the INPUT statement
July - Goodbye for now, until we meet again.

2018
January - Using SQLOBS to get number of observations from an SQL Query
February - Using the DLCREATEDIR option to create directories
March - DO LOOPs
April - A macro to print top observations in a dataset
May - DO OVER
June - Removing non-printable characters
July - WHILE and UNTIL DO Loops
August - Preventing SAS data sets from accidentally being replaced
September - Putting dataset variables in a certain order with labels
October - Infinate loops and stopping them
November - WHERE, KEEP, DROP or RENAME - which is first in a datastep?
December - Creating a list of varibles in creation order in a dataset

2017
January - Combine Date and Time variables using the DHMS funtion
February - Do an analysis of a variable and put into a macro variable using PROC SQL
March - Variable data conversion, numeric to character or vice versa
April - Looking for extreme values in a variable
May - Using SASHELP.VCOLUM to get a contents of a dataset
June - The CMISS funcation
July - Why use a LENGTH statement?
August - Using SELECT/WHEN/OTHERWISE instead of IF...THEN...ELSE
September - Patients at Risk, Kaplan Meier estimate and Median Survival Time, by visit intervals
October - PROC SQL and the FLOW option
November - The MERGENOBY option
December - Using the READONLY option in the LIBNAME statement

2016
January - Removing non-printable characters, revisited
February - Considerations when writing a specification
March - Grouping numerical results
April - Dataset variable labels, and why they are useful, Part I
May - Dataset variable labels, and why they are useful, Part II
June - WARNING: Engine XPORT does not support SORTEDBY operations
July - Sorting a mixed case variable as if it were only upper case text using PROC SQL
August - Using NOEQUALS option in PROC SORT
September - To remove page breaks and put dashes (-) across the page of output
October - PROC DATASETS and the DETAILS option
November - Mimic PROC MEANS using PROC SQL
December - Variable names and/or values in TITLE, using #BYVAR and #BYVAL

2015
January - Dates and Times, how SAS stores them
February - Combining 500 outputs
March - Example of using LABELs in analysis
April - VBA to print two pages of each document in a folder
May - Grouping an analysis using PROC FORMAT
June - The Results May Not Be What They Seem
July - So You Want To Average a List of Variables
August - PRELOADFMT IS Your Friend
September - Delete an External File Using SAS
October - Using the Input With a CARDS Statement
November - Why run our program in batch mode
December - It may look okay, but does it really work?

2014
January - A quick compare of two directories of data
February - Avoiding writing multiple WHERE statements on difference datasets
March - Creating sets of listings by an ID value
April - Adding one observation to a dataset with multile records
May - DKROCOND option, an a tale of intregue
June - The IN operator, and ranges
July - Adding additional codes to a format
August - A SAS LOG Checker
September - Why use MPRINT, MPRINTNEST, MLOGIC, MLOGICNEST, SYMBOLGEN and SOURCE2
October - Finding and replacing unprintable characters
November - ADS Specifications
December - Important Reminders While Programming

2013
January - An old way to update a dataset, using the MERGE statement
February - Array calculations
March - Comment out code using a dummy macro
April - Creating a DOS Batch File for running a set of SAS programs
August - Using PROC IMPORT to import data from an Excel file
May - Adding an observation number to each observation in a SAS dataset
June - Adding an observation with no values for all variables on to a dataset with no observations
July - Using SAS/WPS with R
September - Using PROC EXPORT to export data to an Excel file
October - Export data to Excel creating a sheet for each BY value
November - Pickup up a missing BY statement when merging data
December - Using PROC FREQ to get what you need

2012
January - Breaking apart a dataset using variable values, Part 1
February - Breaking apart a dataset using variable values, Part 2
March - LOG and OUTPUT text to one file
April - Accessing a dataset without a LIBNAME reference
August - Removing dummy records from a directory of datasets
May - Using variable ranges instead of a list of individual variables
June - Creating a list of datasets into a macro variable, and why this may be useful
July - Counting the number of COMPLETE months between two dates
September - Suspending LOG output to the LOG
October - Getting a list of formats from a FORMATS library, without detail
November - Including external SAS files in your program
December - Finding the mean, minimum and maximum values for a quartile

2011
January - A very useful macro, PROC CONTENTS followed by a listing of the first 25 observations
February - A detour into VBA -- printing the first 2 pages of an output for all RTF files in a directory
March - Creating a footer with a horizonal line above using GETOPTION
April - SOURCE2 -- printing out source code from a %INCLUDE file
May - Another detour to VBA --a macro to convert all RTF files in a directory to ASCII Text files
June - If no observations to report, output a message saying "no observations" to the report
July - Sending an Email from SAS
August - How many values are in a macro variable?
September - Getting what SAS code is run in CONFIG and AUTOEXEC to the LOG
October - Capturing Results from a SAS Statistical Procedure, Using ODS
November - Capturing Results from a SAS Statistical Procedure, Using PROC PRINTTO and a Data Step
December - How to track and avoid values being overwritten when merging datasets

2010
January - How can an external file be deleted using SAS
February - Does the NODUPKEY option is PROC SORT always select the first record in a group of records?
March - DROPing and KEEPing variables using the DATASETS procedure
April - Get the Option settings and use in your program
May - Making a datastep act like a PROC APPEND
June - Generating a list of integers from 1 to 10 inclusive
July - Breaking a large dataset into parts
August - Using ACCESS=READONLY to avoid writing over datasets in a directory
September - A Quick Look at WPS version 2.5 -- a real alternative to SAS?
October - Using NOOBS and LABEL in PROC PRINT
November - PROC PRINT, ID and BY statements
December - And finally, PROC PRINT with SUM, BYLINE and HTML!

2009
January - SUM(OF variables)

February - Getting rid of the message "NOTE: BASE data set does not exist. DATA file is being copied to BASE file."
March - Delete all datasets in a library, except ...
April - More on using a FORMAT to merge data
May - Why use dataset variable labels?
June - Prefixing a value with '+' or '-'
July - I am missing a '0' in front of my day value, can SAS still read it okay? (or can SAS read a text date of '6JUN2009' correctly)
August - Selecting data for a particular month
September - Comparing all datasets in one directory against all the datasets in a second dataset, using CALL EXECUTE
October - The Use and Abuse of the NODUPKEY option in the SORT Procedure
November - Looping the loop with DO loops
December - A Many to Many Merge using a Data Step

2008
January - Stripping (text)
February - Enclosing a negative value within brackets
March - Get a listing of all the SAS programs for a particular directory
April - Transposing the data and label
May - Creating a Batch File
June - Making a SAS Transport File
July - How would I set all variables of an observation to missing?
August - Numeric to Character Conversion
September - Character to Numeric Conversion
October - Making a copy of a SAS dataset, Part 1
November - How would I set only character or numeric variables of an observation to missing?
December - Making a copy of a SAS dataset, Part 2

2007
January - FLOOR, CEIL, ROUND and INT
February - The trig functions
March - Deleting old datasets using a date
April - Removing labels and formats from all variables inside a dataset
May - What SAS modules are on your system, and how to work around those that are missing
June - PROC MEANS vs PROC SUMMARY
July - The COLLATE function
August - I just received a dataset with the dates in dd/mm/yy format but I want them in mm/dd/yy format for my report
September - Since when does a null string have a length of 1?
October - Renaming a SAS dataset variable
November - The MISSING function
December - The CALL MISSING Routine

2006
January - Four Common Ways to Merge Two Datasets
February - TRIM and TRIMN
March - SQL and the CALCULATED keyword
April - Six ways to make your program run faster
May - Does x+y = SUM(x,y), revisited
June - Why use DATA _NULL_
July - LOWCASE/UPCASE/PROPCASE
August - Does the string contain a number?
September - FORMCHAR
October - Using CARDS or DATALINES to input data
November - Using the DHMS function to create a datetime value
December - Creating a graph using ODS RTF

2005
January - How does SAS store your date and/or time?
February - Sometimes, overwriting a dataset does not replace it
March - The 2005 Conference Season begins
April - Finding a duplicate key record, Part II
May - The Variance results from SAS and Excel are different!
June - Using PROC CHART to do a quick frequency analysis
July - Deleting a SAS dataset, revisited
August - Using SASHELP.VMACRO to view your macro variables, and %SYMDEL to delete them
September - Getting the last word in a string using SAS or Excel
October - The COMPARE function
November - The DIM function for repeating the same action of different variables
December - The CANCEL option in the RUN command

2004
January - A BAT to create a Backup of your file
February - FIRSTOBS=, OBS=
March - Finding a duplicate key record
April - Getting a Cell Comment inside an Excel Worksheet
August - Common Mathematical Operators
May - The 2004 Conference Season begins
June - BYTE/RANK (this is not eating a hamburger)
July - Getting the background color from an Excel Worksheet cell
September - Adding a value to an existing format
October - Does a macro variable exist in your program?
November - An example of some unexpected results
December - Does x+y = SUM(x,y)?

2003
January - Introduction/Have a notebook handy
February - To avoid confusion, define the variables you create in a datastep
March - Helping a SORT run faster
April - Deleting a SAS dataset
May - INDEX, INDEXW and INDEXC
June - Share your datasets with others, consider the SASViewer
July - Placing Unique values from a dataset into a macro variable
August - COMPRESS or COMPBL, that is the question
September - Sometimes your System Command Call within SAS does not work
October - Coding a missing value
November - Using a format to group basic statistical analysis
December - SAS and Excel do not compute the same quartile value