Skip to content

Instantly share code, notes, and snippets.

View statmike's full-sized avatar
Bootstrapping

Mike Henderson statmike

Bootstrapping
View GitHub Profile
@statmike
statmike / ciabatta.ipynb
Created February 17, 2021 21:01
Ciabatta.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* setup a cas session */
cas mysess sessopts=(caslib='casuser');
libname mycas cas sessref=mysess;
/* how many positive intergers to check for FizzBuzz? */
%let l=1000000; /* size of sequence, per thread */
/* single thread version */
data mycas.FizzBuzz / single=yes;
do until(i=&l.);
@statmike
statmike / Learn CASL.md
Last active June 28, 2022 05:02
Learning CASL (SAS Viya)

A step-by-step tutorial of SAS CASL (Viya)

Run these in interactive mode in this order:

  • begin.sas - start CAS session, simulate data, review data in CAS
  • tip_1.sas
  • ...
  • tip_13.sas
  • end.sas - end and clear CAS session

Programming Documentation

@statmike
statmike / list_to_rows.md
Last active April 28, 2026 20:12
SAS: Convert string with a delimited lists into rows

Synopsis

This code snippet uses a SAS datastep to convert a string of values into a column with multiple rows containing the individual values. See the examples below before going down to the code snippet.

Example

Data for Examples

data example;
	infile datalines dsd;
	informat Cat_1 $1. LIST_VAR $40.;
	input Cat_1 LIST_VAR;
@statmike
statmike / rows_to_list.md
Last active May 30, 2024 23:44
SAS: Convert values in a column into a delimited list (works with By Variables)

Synopsis

This code snippet uses a SAS datastep to convert a column of values into a delimitted list in a string. This code also works when you have 'by group' where you want a separate list for each level of a column or combination of columns. See the examples below before going down to the code snippet.

Examples

Data for Examples

data example;
	input Cat_1 $ Cat_2 $ String $;
	datalines;
A A APPLE