Strengthen your programming skills with tips and techniques from the experts

CAS libraries enable you to access your CAS data. By defining the librefs for those caslibs in SAS Studio, you can have more interactive access to the CAS data.

Strengthen your programming skills with tips and techniques from the experts

How to view CAS tables in SAS® Studio

CAS libraries enable you to access your CAS data. By defining the librefs for those caslibs in SAS Studio, you can have more interactive access to the CAS data.

A Novice Perspective on SAS Viya Deployment

This post is written in the hopes of easing the SAS Viya deployment process for novices like me. Firstly, deploying SAS Viya, like most enterprise software packages, isn't a skill we're innately born with. We're going to need a little help, some good documentation, and time to absorb the intricoes

The expected number of points on a convex hull

While discussing how to compute convex hulls in SAS with a colleague, we wondered how the size of the convex hull compares to the size of the sample. For most distributions of points, I claimed that the size of the convex hull is much less than the size of the

Using variable names with special characters

When we wrote the sixth edition of The Little SAS Book: A Primer, one of our goals was to write it for all SAS programmers regardless of which interface they use for coding: SAS Studio, SAS Enterprise Guide, the SAS windowing environment, or batch. This is harder than it sounds.

Enhancing a scatter plot

A scatter plot is my go-to graph! It's what I often start with to get a feel for the data ... and I often end up using just a scatter plot. But some scatter plots are better than others ... In this blog post, I create a scatter plot of

Caslibs and librefs in SAS Viya

When SAS 9 programmers transition to SAS Viya, there are inevitably questions about how new concepts in Cloud Analytic Services (CAS) relate to similar concepts in SAS. This article discusses the question, "What is the difference between a libref and a caslib?" Both are used to access data, but they

The order of vertices on a convex polygon

In a previous article, I showed how to use theCVEXHULL function in SAS/IML to compute the convex hull of a finite set of planar points. The convex hull is a convex polygon, which is defined by its vertices. To visualize the polygon, you need to know the vertices in sequential

Creating Simulated Data Sets (Part Two)

This blog is a continuation of a previous blog that discussed creating simulated data sets. If you have not seen it, you might want to review it, especially if you are not familiar with the RAND function. The program that I'm going to show you simulates a drug study with

Two-dimensional convex hulls in SAS

Given a cloud of points in the plane, it can be useful to identify the convex hull of the points. The convex hull is the smallest convex set that contains the observations. For a finite set of points, it is a convex polygon that has some of the points as

Where do Canadians live?

Canada is a geographically large country, but I've heard that much of the population lives in the small southernmost sections (near the US border). I decided to use my mapping skills, and put that to the test. Follow along, and we'll see what that looks like on a map ...

How I used a SAS ML model and Intelligent Decisioning to build a calculator

If you are thinking that nobody in their right mind would implement a Calculator API Service with a machine learning model, then yes, you’re probably right. But considering curiosity is in my DNA, it sometimes works this way and machine learning is fun. I have challenged myself to do it,

Creating Simulated Data Sets

There are times when it is useful to simulate data. One of the reasons I use simulated data sets is to demonstrate statistical techniques such as multiple or logistic regression. By using SAS random functions and some DATA step logic, you can create variables that follow certain distributions or are

Additional statistical capabilities in the containerized deployment of SAS Analytics Pro

SAS Analytics Pro consists of three core elements of the SAS system: Base SAS®, SAS/GRAPH® and SAS/STAT®. The containerized deployment option adds the full selection of SAS/ACCESS engines making it even easier to work with data from virtually any source.

Where are people moving to/from in the US?

With the 2020 Census numbers starting to come out, it's interesting to look at what states are gaining (or losing) people. In this example, I create a custom map similar to the ones the US Census Bureau likes to use, and plot the 10-year change in population. But before we

Creating a React web app using SAS Viya

From articles I've read on the web, it is clear that data is gold in the twenty-first century. Loading, enriching, manipulating and analyzing data is something in which SAS excels. Based on questions from colleagues and customers, it is clear end-users are willing to display data handled by SAS outside

How to (mis)label a map

This blog post is mostly just a bunch of fun maps ... maps that are labeled (or mislabeled) in various ways, using fun/interesting data. I focus on the 'fun' part, but if you're not careful you might also learn a little about the various ways to add labels to maps

Debugging a stored-process problem

Have you ever submitted a stored process, and instead of the expected output, you saw errors or no output at all? Depending on how you submit the stored process, various logs are available to assist you with debugging. This article provides guidance for understanding which situations call for which logs, where to find each log, and what you should look for in each log.

Which countries consume the most coal?

These days, many countries are moving away from coal, and towards natural gas, hydro, wind, and solar as ways to meet their electricity needs. I had heard that some countries still use a lot of coal (especially those countries with large coal deposits), and I was curious which countries use

Crossover and mutation: An introduction to two operations in genetic algorithms

This article uses an example to introduce to genetic algorithms (GAs) for optimization. It discusses two operators (mutation and crossover) that are important in implementing a genetic algorithm. It discusses choices that you must make when you implement these operations. Some programmers love using genetic algorithms. Genetic algorithms are heuristic

Captain Kirk travels into space!

Recently, the news has been all abuzz about William Shatner traveling into space. This was a cool event because he's the oldest person who has traveled into space (at 90 years old) ... and he was also the iconic Captain Kirk from the original Star Trek television series. This got

Introducing TRIMS function to remove any leading and/or trailing characters from SAS strings

Leonid Batkhan introduces multipurpose TRIMS function that removes any leading, trailing or both leading and trailing characters from SAS strings.

Encrypting Data Using SAS

There are many reasons why you might want to encrypt data. I use a SAS program to encrypt a list of logon names and passwords. Before we get started describing how to encrypt data, let's discuss some basic concepts concerning encrypting and decrypting data. All computer data is stored as

Penalties versus constraints in optimization problems

Sometimes we can learn as much from our mistakes as we do from our successes. Recently, I needed to solve an optimization problem for which the solution vector was a binary vector subject to a constraint. I was in a hurry. Without thinking much about what I was doing, I

CAS-Action! Executing the SAS DATA Step in SAS Viya

Just because you are using CAS actions doesn't mean you can forget about the powerful SAS DATA step. The dataStep.runCode CAS action is here! Welcome back to my SAS Users blog series CAS Action! - a series on fundamentals. I've broken the series into logical, consumable parts. If you'd like

Let's dive into some data - SCUBA site data!

SCUBA diving is one of those activities that should be on your bucket list - everyone should experience it at least once! But where should you go diving? ... Coral reefs are always popular - and they are typically in shallow water, making it an 'easy' dive. But, being in

Logical negation of vectors

In a matrix-vector language such as SAS/IML, it is useful to always remember that the fundamental objects are matrices and that all operations are designed to work on matrices. (And vectors, which are matrices that have only one row or one column.) By using matrix operations, you can often eliminate

Jedi SAS Tricks: 5 Ways to Make Your SAS Code Run Faster

Tired of waiting for answers? Then make your SAS code run faster with these 5 tips.

CAS-Action! Executing SQL in SAS Viya

SQL is an important language for any programmer working with data. In SAS Cloud Analytic Services (CAS) you can execute SQL queries using the fedSQL.execDirect CAS action! Welcome back to my SAS Users blog series CAS Action! - a series on fundamentals. I've broken the series into logical, consumable parts.

Authentication to SAS Viya: a couple of approaches

In my blog series regarding SAS REST APIs (you can read all of my posts on this topic here) I outlined how to integrate SAS analytical capabilities into applications. I detailed how to construct REST calls, build body parameters and interpret the responses. I've not yet covered authentication for the

CAS-Action! Simply Distinct - Part 2

In my previous post CAS-Action! Simply Distinct - Part 1 I reviewed using the simple.distinct CAS action to explore distinct and missing values in a distributed CAS table. Welcome back to my SAS Users blog series CAS Action! - a series on fundamentals. I've broken the series into logical, consumable