19
Sep

Shuffling smackdown: Overhand shuffle versus riffle shuffle

Every day I’m shufflin'. Shufflin', shufflin'.       -- "Party Rock Anthem," LMFAO The most popular way to mix a deck of cards is the riffle shuffle, which separates the deck into two pieces and interleaves the cards from each piece. Besides being popular with card players, the riffle shuffle is [...]

The post Shuffling smackdown: Overhand shuffle versus riffle shuffle appeared first on The DO Loop.

Read More
18
Sep

Using machine learning to improve tumor biopsies

How can you use analytics to design better biopsies and improve outcomes? This high school student has some ideas, and she presented them at Analytics Experience 2018.

Using machine learning to improve tumor biopsies was published on SAS Users.

Read More
18
Sep

Hurricane Florence: rainfall totals in the Carolinas

"We been through every kind of rain there is. Little bitty stingin' rain, and big ol' fat rain, rain that flew in sideways, and sometimes rain even seemed to come straight up from underneath." Was that a quote from the Forrest Gump movie, or something said regarding Hurricane Florence? Could be either one! Hurricane Florence recently came through [...]

The post Hurricane Florence: rainfall totals in the Carolinas appeared first on SAS Learning Post.

Read More
18
Sep

Three Proc SQL Tips from Bestselling Author Kirk Paul Lafler

SAS Press author Kirk Paul Lafler's favorite tips using PROC SQL. The post Three Proc SQL Tips from Bestselling Author Kirk Paul Lafler appeared first on SAS Learning Post. Read More
17
Sep

Essential SAS tools to bring to your next hackathon

To succeed in any data-focused hackathon, you need a robust set of tools and skills – as well as a can-do attitude.  Here's what you can expect from any hackathon: Messy data.   It might come from a variety of sources, and won't necessarily be organized for analytics or reporting.  That's [...]

The post Essential SAS tools to bring to your next hackathon appeared first on The SAS Dummy.

Read More
17
Sep

Linearly spaced vectors in SAS

The SAS/IML language and the MATLAB language are similar. Both provide a natural syntax for performing high-level computations on vectors and matrices, including basic linear algebra subroutines. Sometimes a SAS programmer will convert an algorithm from MATLAB into SAS/IML. Because the languages are not identical, I am sometimes asked, "what [...]

The post Linearly spaced vectors in SAS appeared first on The DO Loop.

Read More
14
Sep

ColumnLength macro function

There are times when you need to dynamically obtain the data type and length of a SAS data set column. This occurred for me when I was writing a generic post process following a proc means with a conditional class statement. I need to know the data type and length of the class variable so that it can be assigned in the ATTRIB statement.

The below code utilizes the %isblank macro function that can be found here. The results of the function will be a dollar sign ($) if it is a character data type followed by the length of the data set column.

The table reveals the various results of calling this macro:

Call Result Message
%columnlength(dsn=class, column = age); 8
%columnlength(dsn=class, column = name); $8
%columnlength(dsn=classx, column = name); ERROR: The data set classx does not exist.
%columnlength(dsn=class); ERROR: You must pass in a value for column.
%columnlength(dsn=class, column = namex); ERROR: Could not find column: namex

Here is an example of how I used this. I have a macro that includes a proc means/summary with a conditional class statement. After the process is finished I want to control the formatting, order and even add a new column. So this is my code snippet


data &dsn;
attrib
yyyymm length = $6
%if not %isblank(&classvar( %then %do;
&classvar length = %columnlength( dsn = &dsn, column = &classvar)
%end;
...

%macro columnlength(
dsn =
, column =
);

%local
dsid
position
type
retval
;

%if not %sysfunc(exist(&dsn)) %then %do;
%put %str(E)RROR: The data set &dsn does not exist.;
%return;
%end;

%if %isblank(&column) %then %do;
%put %str(E)RROR: You must pass in a value for column.;
%return;
%end;

%let dsid = %sysfunc(open(&dsn.));
%if &dsid %then %do;
%let position = %sysfunc(varnum(&dsid, &column));
%if &position = 0 %then %put %str(E)RROR: Could not find column: &column.;
%else %do;
%if %sysfunc(vartype(&dsid, &position)) = C %then %let type = $;
%let retval = &type%sysfunc(varlen(&dsid, &position));
%end;
%let dsid = %sysfunc(close(&dsid));
%end;

&retval
%mend;
Read More
13
Sep

Publishing and running models to Hadoop in SAS Viya

This post goes through the steps to build complex models in SAS Model Studio and publish and run them to Hadoop in SAS Viya.

Publishing and running models to Hadoop in SAS Viya was published on SAS Users.

Read More
12
Sep

Two interfaces for typing text by using a TV remote control

Have you ever tried to type a movie title by using a TV remote control? Both Netflix and Amazon Video provide an interface (a virtual keyboard) that enables you to use the four arrow keys of a standard remote control to type letters. The letters are arranged in a regular [...]

The post Two interfaces for typing text by using a TV remote control appeared first on The DO Loop.

Read More
10
Sep

Advanced ODS Graphics: Unicode, tables, and graphs

You can use Unicode to display special characters in SAS output including tables and graphs. With graphs that analytical procedures produce, you might need additional steps. The post Advanced ODS Graphics: Unicode, tables, and graphs appeared first on ... Read More
Back to Top