Leonid Batkhan | May 30, 2023
This article introduces SAS macro function %embed( ) allowing to inject into SAS programs native DBMS SQL queries from external files. It also demonstrates how to embed other languages' code (Python, R, Lua) from external files into SAS code. Read More▸
Leonid Batkhan | January 11, 2023
This article demonstrates programming technique and presents a SAS macro that replicates (clones) metadata users’ groups and roles from one user to another. Read More▸
Leonid Batkhan | November 08, 2022
This SAS administration tutorial presents various SAS programming solutions on how to identify and prevent duplicate LIBREFs in SAS 9 metadata. Read More▸
Leonid Batkhan | October 18, 2022
This article demonstrates programming technique to build adaptive SAS programs to facilitate transition between various environments for a smoother SDLC. Read More▸
Leonid Batkhan | September 20, 2022
This article introduces Windows batch files scripting language and demonstrates how to use them for conditional execution and effective job scheduling. Read More▸
Leonid Batkhan | July 07, 2022
This article demonstrates how to programmatically split a data table into multiple Excel spreadsheets (tabs) in a single workbook. Tabs are color-coded and properly labeled. Read More▸
Leonid Batkhan | June 16, 2022
This article demonstrates how to automate and improve a sometimes onerous hands-on process of creating Excel workbooks. Also shows how to enhance your Excel views with font and background colors as well as frozen headers. Read More▸
Leonid Batkhan | March 14, 2022
For Pi Day, Leonid Batkhan offers a contrarian view on areas and volumes calculations proposing their pi-less formulae. The key here is what units to use for measuring areas and volumes - square and cubic units or else...Read More▸
Leonid Batkhan | February 16, 2022
This is an introduction to SASjs - a collection of tools aimed at enabling and accelerating development and operations (DevOps) for a broad range of SAS applications, including SAS web development. Read More▸
Leonid Batkhan | January 13, 2022
This article describes and discusses pros and cons of 3 different algorithms and SAS code implementations to calculate length of overlap of date/time intervals and integer intervals in general. Read More▸
Leonid Batkhan | October 14, 2021
This article introduces and implements multipurpose TRIMS function that removes any leading, trailing or both leading and trailing characters from SAS strings. Read More▸
Leonid Batkhan | September 02, 2021
This article describes and discusses pros and cons of 3 different algorithms and SAS code implementations to calculate length of overlap of date/time intervals and integer intervals in general. Read More▸
Leonid Batkhan | August 23, 2021
This article demonstrates how to remove ANY leading characters (not just blanks) from text strings to tidy up your data. Two different SAS coding solutions are provided. Read More▸
Leonid Batkhan | July 06, 2021
This article reveals little known tips and tricks on how to use versatile iterative DO loops with index variable pertaining to SAS DATA steps. Read More▸
Leonid Batkhan | June 14, 2021
This article presents and elucidate SAS macro implementation of parallel processing by spawning multiple SAS sessions using SYSTASK statements with subsequent synchronization. Read More▸
Leonid Batkhan | April 14, 2021
This article explores and presents shell scripting solution as an alternative way of implementing SAS parallel processing. For the described use case, overall processing duration was cut roughly by a factor of 25... Read More▸
Leonid Batkhan | April 01, 2021
For centuries, people around the world have been busy scratching their heads in search of a meaningful answer to Shakespeare’s profoundly elementary question: "To be or not to be?" Here is how it applies to SAS... Read More▸
Leonid Batkhan | March 24, 2021
This article reveals a fuss-free way to conditionally halt SAS program execution and terminate SAS session in batch-processing scenarios. Read More▸
Leonid Batkhan | March 15, 2021
This article explains SAS global statements and presents several coding techniques that give you control of when and whether SAS global statements are executed. Read More▸
Leonid Batkhan | February 22, 2021
This article demonstrates SAS coding techniques of deleting a substring from a character string - one of the common character data manipulation tasks. Read More▸
Leonid Batkhan | February 15, 2021
This article demonstrates SAS coding techniques of inserting a substring into a character string - one of the common character data manipulation tasks. Read More▸
Leonid Batkhan | January 27, 2021
You can learn SAS and have fun at the same time. Join me at SASensei, an independent, third-party online SAS learning resource (game). Read More▸
Leonid Batkhan | January 13, 2021
The article demonstrates a popular "divide-and-conquer" efficiency strategy using parallel computation with SAS/Connect® that allows for substantial reduction in processing time. Read More▸
Leonid Batkhan | November 04, 2020
The article presents and explains the data cleansing technique of removing unwanted repeated characters in SAS character variables; not just duplicate blanks, but any duplicated characters. Read More▸
Leonid Batkhan | October 15, 2020
This post summarizes a lesser known but useful feature in SAS that allows you to bring Microsoft Excel functions into your SAS programs. Read More▸
Leonid Batkhan | September 17, 2020
The article reviews SAS functionality related to the character strings quoting/unquoting, then dives deep into unquoting SAS character variables. Read More▸
Leonid Batkhan | August 12, 2020
This article reveals how to change lengths for all character variables in a data set and all data sets in a data library to facilitate data migration to Unicode encoding environment. Read More▸
Leonid Batkhan | July 23, 2020
This article shows you how to split a large data set into many subsetting it by a number of observations to produce smaller, better manageable data sets. Read More▸
Leonid Batkhan | May 27, 2020
This article describes programming technique for creating multi-purpose SAS® Macro functions. One of the arguments serves as a modifier to achieve multi functionality. Read More▸
Leonid Batkhan | April 22, 2020
This article differentiates between SAS macro and SAS programming languages, defines two types of SAS macros and explains how to create SAS macro functions. Read More▸
Leonid Batkhan | March 10, 2020
This article describes how to automate creation of SAS variable labels so tables and reports are easier to read. New labels are derived from column names ... Read More▸
Leonid Batkhan | January 27, 2020
This blog post demonstrates process and SAS coding techniques to shift dates by a given number of workdays accounting for weekends and holidays. Read More▸
Leonid Batkhan | December 09, 2019
This blog post demonstrates how to compare SAS data sets that include common and uncommon columns. You'll learn how to check mark commonalities and color-code differences in data tables. Read More▸
Leonid Batkhan | October 30, 2019
This article demonstrates use cases and programming techniques for creating in SAS comparison matrixes also known as checklist tables or checklist table charts. Read More▸
Leonid Batkhan | September 16, 2019
This articles covers lightning-fast SAS® Scalable Performance Data Server libraries and programming technique of capturing their contents. Read More▸
Leonid Batkhan | August 18, 2019
Have you ever thought of selling sand on the beach? Neither have I. To most people the mere idea is preposterous. But isn’t it how all great discoveries, inventions and breakthroughs are made? Someone comes up with an outwardly crazy idea and ... Read More▸
Leonid Batkhan | July 17, 2019
Have you ever tried to pass comma-delimited values to SAS macro or to a SAS macro function? How can SAS distinguish commas separating parameters or arguments from commas separating parts of the values? Read More▸
Leonid Batkhan | June 26, 2019
This article solves a problem of parsing a character string to find a position of n-th occurrence of a group of characters (substring) in that string. Read More▸
Leonid Batkhan | May 08, 2019
This article dispels all the fallacies and delusions about division by zero in a SAS DATA step. Are you familiar with the divide() function in SAS? Read More▸
Leonid Batkhan | April 01, 2019
Whether you are a strong believer in the power of dividing by zero, agnostic, undecided, a supporter, denier or anything in between and beyond, this blog post will bring all to a common denominator. Read More▸
Leonid Batkhan | March 05, 2019
This article describes how to conditionally stop and exit SAS batch script running several SAS programs in Unix/Linux environments. This is especially useful when such jobs run on schedule unattended. Read More▸
Leonid Batkhan | February 06, 2019
This article describes SAS programming technique for splitting raw text file or a data table into many raw text files. Read More▸
Leonid Batkhan | January 09, 2019
This article describes a data preparation approach and SAS coding technique that will significantly simplify, unclutter and streamline your SAS programming life by using data templates. Read More▸
Leonid Batkhan | July 17, 2018
This article presents a SAS program (macro %mr_clean) that cleans up old log files on your system from a specified directory. And not only log file, but any files that are no longer needed. Read More▸
Leonid Batkhan | May 30, 2018
It is imperative for developers, whether hardware or software engineers, to foresee unintended (probable or improbable) system usages and implement features that will make their creations foolproof, that is protected from misuse. Read More▸
Leonid Batkhan | May 07, 2018
This article features four SAS tools for GDPR compliance which allow protecting personal data in SAS reports by suppressing counts in small demographic group reports. Read More▸
Leonid Batkhan | April 01, 2018
Inspired by curiosity and backed by the most powerful analytics in the world, SAS discovers a new planet in our Solar system. See how we used SAS Viya to make this historic discovery. Read More▸
Leonid Batkhan | January 25, 2018
If Necessity is the mother of Invention, then, perhaps, the father of Automation is Laziness. Automation is all about convenience, comfort, and productivity. Why do it yourself if you can devise something to do it for you! Read More▸
Leonid Batkhan | December 19, 2017
While SAS program development is usually done in an interactive SAS environment, when it comes to running SAS programs in a production or operations environment it is routinely done in batch mode. Read More▸
Leonid Batkhan | November 01, 2017
This blog post demonstrates a SAS coding technique that allows for calculations with multiple variables from different observations across a SAS dataset. Read More▸
Leonid Batkhan | October 10, 2017
This blog post describes a wealth of styling options available in SAS Enterprise Guide. It also covers CSS styles and server-side styles as they apply to SAS EG. Read More▸
Leonid Batkhan | September 15, 2017
This blog post describes how to use regular web browser as an editing software. That is right, you can write your code, articles, papers, etc. in a web browser. Read More▸
Leonid Batkhan | August 02, 2017
CALL EXECUTE is a powerful tool for developing dynamic data-driven SAS applications. This blog post demonstrates its benefits and clearly explains how to avoid its pitfalls and use it efficiently to your advantage. Read More▸
Leonid Batkhan | June 06, 2017
In this blog post, author reverses the ancient political maxim "divide and conquer" and demonstrates how you can utilize the backwards principle "combine and then conquer" for problem solving. Read More▸
Leonid Batkhan | April 27, 2017
This article presents various ETL implementations and data-driven programming techniques for automating multiple database tables load into SAS tables. Read More▸
Leonid Batkhan | April 13, 2017
This article demonstrates how you should protect passwords in SAS programs. Even if you are a traditional SAS programmer and have nothing to do with cybersecurity, you still probably have to deal with this issue in your day-to-day work. Read More▸
Leonid Batkhan | April 01, 2017
In this special occasion blog post author presents a creative and powerful SAS code that effectively proves the long-standing Fermat's Last theorem. Read More▸
Leonid Batkhan | March 28, 2017
This article demonstrates how you can change SAS dataset's variable type and/or variable length in place, without adding new variables. If you believe it can’t be done, read this article from very beginning. Read More▸
Leonid Batkhan | February 10, 2017
While truncation vs rounding may seem to be insignificant in a given instance, the cumulative effect of either could be truly enormous when it comes to time values. Read More▸
Leonid Batkhan | December 15, 2016
This article demonstrates how to truncate displayed numeric values to a specified number of decimal places without rounding. It's a bit trickier than it seems. Read More▸
Leonid Batkhan | November 25, 2016
Variable attributes update process can be fully automated and consistently applied to all datasets in a SAS library using described here approach. Read More▸
Leonid Batkhan | May 23, 2016
In this article author illustrates why and how you should first articulate and define purpose before jumping to formulating and solving a problem. Read More▸
Leonid Batkhan | April 13, 2016
Have you ever used SAS to produce reports for publishing? Have you ever thought of or been told about suppressing data in such reports? Why do we need to suppress (in the sense of withholding, concealing, obscuring or hiding) data in published reports? Read More▸
Leonid Batkhan | March 04, 2016
Contrary to the data step DO-loops which iterate during execution time, SAS macro loops are completely different creatures as they do not iterate during execution time, but rather during code compilation time. Read More▸
Leonid Batkhan | February 04, 2016
Programming loops are a staple of any computer programming language. In all programming loops, a group of statements is executed repeatedly based on the value of an index variable that changes from one iteration to another. Read More▸
Leonid Batkhan | January 13, 2016
If you are a SAS Admin who adds and removes SAS users in the SAS Management Console, assigns them to Groups and Roles, maintains their General information and user Accounts, then you know that when number of users grow, at some point things can get messy. Read More▸
Leonid Batkhan | November 03, 2015
This article demonstrates SAS' PROC GEOCODE usage for getting latitudes and longitudes of a location specified only by its postal address. Then this location is easily tagged with a marker on Google maps. Read More▸
Leonid Batkhan | July 16, 2015
This article demonstrates an interactive two-pane solution combining Google map and SAS-generated report (graphics, tabular, etc.) showing pertinent information based on the interaction with the Google map. Read More▸
Leonid Batkhan | June 05, 2015
This article demonstrates SAS programming technique of building interactive Google map overlaying a pop-up window (InfoWindow) with SAS-generated ODS HTML report pertinent to the location clicked on the Google map. Read More▸
Leonid Batkhan | March 20, 2015
There are real-life cases when reversing graph axes make sense. For example, when Y-axis represents a depth under the sea level or depth of oil well drilling, it makes perfect sense to have zero on top and positive numbers increasing from top down. Read More▸
Leonid Batkhan | January 21, 2015
This post presents a simple programming tool that allows you to measure duration of your SAS program. It can be easily embedded in your SAS code and is very useful for programs efficiency benchmarking. Read More▸
Leonid Batkhan | November 28, 2014
This article demonstrates a SAS program that builds drillable Google maps. When you click on a region, you will be effectively drilling down on that region and will be presented with a second level of the Google map. Read More▸
Leonid Batkhan | October 13, 2014
This article demonstrates a SAS program that builds interactive Google maps allowing to draw (overlay) draggable circles of adjustable sizes over it. Read More▸
Leonid Batkhan | September 12, 2014
This article demonstrates a SAS program that builds live Google maps allowing to overlay interactive InfoWindows capable of displaying all sorts of information, including YouTube videos, graphs, tables, etc. Read More▸
Leonid Batkhan | August 29, 2014
This article demonstrates a SAS programming technique to draw a closed geometric shape, in particular, a polygon, on a Google map. Overlaying polygons on a Google map is a great visualization for geographical and administrative regions ... Read More▸
Leonid Batkhan | July 24, 2014
This blog post demonstrates how to use SAS programming to generate interactive Google map with multiple points (or markers, using Google terminology) and incorporate it into SAS HTML output. Read More▸
Leonid Batkhan | July 09, 2014
This article presents the best practices for setting up SAS Business Intelligence (SAS BI) environments. It covers folder structures for software life cycle environments; explains the difference between SAS metadata folders and OS folders, and more ... Read More▸
Leonid Batkhan | June 06, 2014
This article introduces Google Maps API and illustrates embedding them into any SAS-generated HTML output, in particular embedding Google maps into a SAS stored process and delivering it via a SAS Information Delivery Portal. Read More▸
Leonid Batkhan | May 01, 2014
Autoexec files are very convenient and powerful productivity feature of SAS Enterprise Guide. This article demonstrates various usages of autoexec with EG. Read More▸