22:20, 24th February 2020
How to Import Data: Reading SAS Files in R
Reading SAS files in R is achievable through two dedicated packages, haven and sas7bdat, as well as through the graphical interface of RStudio. The haven package, which forms part of the Tidyverse collection and also supports SPSS and Stata formats, provides the read_sas and write_sas functions for loading and saving sas7bdat files respectively. The sas7bdat package serves the sole purpose of reading SAS files into R dataframes using its read.sas7bdat function. Both packages can be installed via the install.packages() function in R or through Conda.
RStudio users can alternatively import SAS files through the Environment tab's Import Dataset menu, which uses haven in the background to handle the process. Once data has been loaded into a dataframe, it can be exported as a new SAS file using write_sas or converted to CSV format using R's built-in write.csv function.
13:02, 17th February 2020
SAS LIBNAME Statement: JSON Engine
The JSON LIBNAME statement in SAS provides read-only sequential access to JavaScript Object Notation data, reading the file a single time upon assignment and requiring reassignment to read it again. It uses a JSON map file to describe the structure of the data sets within the JSON document, which can either be generated automatically by the JSON engine or supplied manually by the user via the MAP= option.
The automapper produces a separate data set for each object found in the JSON, along with a consolidated ALLDATA data set containing all information in a single structure. Users can inspect generated data sets using procedures such as PROC DATASETS, PROC CONTENTS and PROC PRINT.
Several options govern the engine's behaviour, including AUTOMAP, which controls whether a map file is created or reused, RETAIN, which preserves observation buffer values between observations, ORDINALCOUNT, which determines how many ordinal variables are generated and MEMLEAVE, which manages memory allocation during processing. Map files can be edited manually to rename data sets, restructure variables, specify formats, informats and labels, and control retention at the variable level.
When JSON data spans multiple related data sets, ordinal variables serve as key fields that allow those data sets to be merged into a single consolidated output. The ALLDATA data set can also be manipulated directly using data step logic to extract and reshape information as needed, and the JSONPP DATA step function can be used to produce a human-readable formatted copy of any JSON input.
17:38, 25th November 2019
Elvis SAS Log Analyser
Elvis is a Windows-based application designed to enhance the analysis of SAS logs, offering tools such as the Log Explorer for summarising key events, the Folder View for monitoring log statuses and the Call Tree for visualising macro calls. It supports logs from SAS and the World Programming System, with features including colour-coded line types, quick navigation to errors and the ability to define custom line markers. The software transitioned to a subscription model in version 3.0, with a free trial allowing access to the first 800 lines of each log. Telemetry is enabled by default to collect anonymised usage data for development purposes, though users can disable it through preferences. The application is compatible with Windows 10, 8.1 and 8 and does not require additional runtime dependencies. User feedback highlights its utility for log analysis but notes its Windows-only limitation, with some users questioning its compatibility with z/OS environments.
11:54, 4th November 2019
Using Colours in R
The statistical programming language R provides multiple methods for specifying colours in visual outputs, including colour names, hexadecimal codes, RGB values in both 0-255 and 0.00-1.00 ranges and index numbers referencing a predefined list. A comprehensive list of 657 colour names, excluding white which appears first, is organised alphabetically and corresponds to specific index positions, with some duplicates to account for regional spelling variations or numbering conventions. This data are accessible through an embedded Google Sheet and available for download in Excel or PDF formats, licensed under a Creative Commons Attribution 4.0 International Licence, allowing free use and adaptation provided proper attribution is given to the source.
16:22, 18th October 2019
Raw SAS
The Raw SAS blog is a long-running resource covering the history and practical application of SAS software, spanning posts from 2012 through to 2025. It features a series of articles documenting early issues of "SAS Communications", a newsletter dating back to 1973 that chronicled the formative years of the SAS Project Group, including the transition of SAS into a private company, the emergence of early user groups and the development of successive SAS releases. Alongside this historical content, the blog also covers technical topics such as running SAS on CentOS, managing log locations and working with the SASjs framework, which includes a command-line interface, a server component and a library of over 200 documented macros aimed at SAS application developers.
15:41, 18th October 2019
Modernising Legacy SAS SCL / AF Applications
Legacy SAS/AF applications, developed using the SCL language within Base SAS, were widely used for creating user interfaces but faced challenges such as outdated user experience, security risks, scalability issues and limited support due to the rarity of SCL expertise. Modernisation efforts focus on migrating these applications to HTML5-based web apps, which integrate seamlessly with existing SAS infrastructure and leverage enterprise authentication mechanisms for security. This approach separates frontend design from backend SAS logic, enabling the reuse of core data processing components while replacing the original SCL interface with modern web technologies. A key tool in this transition is the SCL Transcoding Kit, which allows SCL code to be converted into SAS programs for execution in stored processes or job execution services, eliminating reliance on legacy catalogs and AF licences. This method preserves the functionality of original applications while improving maintainability, scalability and user interaction, ensuring continued operation within contemporary IT environments.
20:02, 6th September 2019
The COALESCE function: PROC SQL compared with PROC IML
The COALESCE function in SAS is designed to return the first non-missing value from a list of variables, streamlining processes that would otherwise require multiple conditional statements. An example illustrates its utility in selecting a valid phone number from several potential sources, such as a student's mother's, father's, or home phone number, by prioritising non-missing entries. This function is available in Base SAS and can be utilised within PROC IML, eliminating the need for custom code to replicate its functionality. By leveraging existing Base SAS capabilities, users can efficiently handle missing data across different procedures, demonstrating the flexibility of integrating foundational SAS tools into advanced analytical environments.
13:03, 31st August 2019
Groovy Tutorial
Groovy is an object-oriented, Java-based programming language that supports both static and dynamic typing, functional programming, operator overloading, regular expressions and native compatibility with markup languages such as XML and HTML. First released in January 2007, the language is fully interoperable with Java, allowing developers to use existing Java libraries, and it provides a strong environment for creating Domain-Specific Languages through in-language macros, AST transformations and meta-programming capabilities. It is considered relatively straightforward to learn, particularly for those already familiar with Java, and is used by major companies including Google, Microsoft, IBM, Amazon and Netflix. Experienced Groovy developers in America can command annual salaries of around $120,000, reflecting strong demand in the industry. Those wishing to get started with the language are advised to have a basic working knowledge of Java along with fundamental computing skills such as navigating directories and working with files.
20:23, 29th August 2019
How to set default Java version on Ubuntu / Debian
To set the default Java version on Ubuntu or Debian systems, users can first list installed versions using the update-java-alternatives --list command. They then select the desired version through the update-alternatives --config java interface, which allows manual configuration of the default interpreter. After making changes, the system's environment variables should be updated to reflect the new selection and the current version can be verified with java -version. This process ensures compatibility with applications requiring specific Java implementations and helps manage multiple versions installed on the same system.
14:14, 11th June 2019
JavaRanch
JavaRanch serves as a community hub for Java programming discussions, offering forums, learning resources and interactive elements such as games and book recommendations. The platform includes sections for troubleshooting, certification guidance and technical queries, alongside links to related topics like permaculture and sustainable living. A journal provides updates, articles and reviews, while the site maintains a focus on fostering collaboration among users through its structured yet approachable environment.