Macro
Code Diary Documentation Generation

Script for configuring and executing the generation of technical documentation from SAS code.

View code
ETL
CAS Table Partitioning and Sorting

Demonstration of CAS performance optimization through data partitioning and sorting during loading.

View code
ETL
Using LAG and DIF Functions

This SAS script demonstrates the use of LAG and DIF functions within a DATA STEP to create new variables based on pre...

View code
Général
Sans titre

Simple example of using the COUNT function to count occurrences of a substring.

View code
Data Manipulation
Using COUNT and COUNTC functions

This SAS script demonstrates the use of COUNTC and COUNT functions to count character and substring occurrences withi...

View code
Macro
String List Formatting Utility (CQUOTE)

Converts a space-separated list of values into a comma-separated quoted list.

View code
Général
Sans titre

Macro to display the names, types, and formats of variables for one or more datasets.

View code
Macro
List Conversion and Formatting Macro

This utility macro converts a list of elements (provided as a delimited string) into a new formatted list. It offers ...

View code
Statistical
Correlation Coefficient Demonstration and Animated GIF

SAS macro simulating data with a specific correlation coefficient and producing a graphical visualization.

View code
Statistical
CORRESP Macro - Correspondence Analysis

SAS macro for performing simple and multiple correspondence analyses (MCA) with extended graphical options.

View code
Macro
Macro %compress for string management

This SAS macro encapsulates the COMPRESS function to remove specified characters from a text string, with error handl...

View code
Général
Sans titre

This SAS script defines and uses FCMP functions to calculate a person's age relative to a given date or the current d...

View code
Reporting
Generation of Connected Scatterplots with SGPLOT

Script generating connected scatterplots based on the Iris dataset.

View code
Chart
100% Stacked Bar Chart with SGPLOT

This SAS script generates a 100% stacked bar chart to visualize the proportional contribution of different series wit...

View code
Graphical Reporting
100% Stacked Bar Chart (3D) with SGPLOT

This SAS script generates a 100% stacked bar chart with 3D shading, using the SGPLOT procedure. It first prepares the...

View code
Macro
Colnames Macro: List Variables (R-style)

Utility macro simulating R's colnames() function to list variables of a SAS table located in the WORK library.

View code
Général
Sans titre

Functional macro to replace the last occurrence of ', ' (comma-space) in a character string with ' and '.

View code
Macro
Macro to replace the last comma with ' and '

This macro replaces the last occurrence of the sequence ', ' (comma-space) with ' and ' in a given character string, ...

View code
Reporting
3D Grouped Bar Chart Generation with ODS HTML

This SAS script generates a grouped bar chart with 3D shading using PROC SGPLOT and publishes it in HTML format. Data...

View code
Reporting
SGPLOT Stacked Bar Chart Generation

This SAS script generates a stacked bar chart using PROC SGPLOT and ODS HTML, displaying the contribution of differen...

View code
Reporting
3D Stacked Bar Chart with PROC SGPLOT

This SAS script generates a 3D stacked bar chart using PROC SGPLOT and the Output Delivery System (ODS) to produce HT...

View code
Général
Sans titre

This SAS script illustrates the use of the CAUSALMED procedure to analyze the effect of smoking on infant mortality, ...

View code
Macro
Global Test Execution

This script initializes the environment via autoexec and launches all tests defined by the %test macro.

View code
Reporting
Dynamic Printing of a SASHELP Table

Displays the content of a SASHELP library table defined by a macro variable.

View code
Reporting
Generate Stored Process Launch Form

Generates a dynamic HTML interface to launch a Stored Process with custom parameters.

View code
Reporting
Dynamic Web Form Generation for SAS Execution

Generation of a dynamic HTML page serving as an interface to launch a SAS program with user-selected parameters.

View code
Reporting
Grouped Bar Chart with SGPLOT

This SAS script generates a Grouped Bar Chart using the SGPLOT procedure. Data is created directly within the script ...

View code
Macro
Macro assertTrue - Check if a condition is true

SASUNIT Macro to evaluate a condition and assert that it is true, handling numeric and character types.

View code
Administration
Windows Temporary Directory Cleanup

SAS macro to delete a specific temporary directory (`c:\tempwork`) and its contents on a Windows operating system.

View code
Statistical
Example of Cluster Analysis with PROC CLUSTER

This script illustrates the use of the CLUSTER procedure to perform a cluster analysis on flight distances between 10...

View code
Utility
Execute a system command and capture output into a dataset

This SAS macro allows executing a local operating system command and capturing its output line by line into a new SAS...

View code
Macro
cmd2sas Macro

SAS macro to execute a local system command and write its output to a data set.

View code
Reporting
HTML Page Closing Macro (Optimization)

Macro used to 'close' an HTML page by redirecting the ODS destination to a dummy page to optimize performance.

View code
Reporting
Sales Visualization with Custom Image Markers

Generation of dummy sales data and creation of combined charts (bar and scatter plots) using custom images as conditi...

View code
ETL
Creation and Addition of ContactType Data

This SAS script creates a temporary dataset `work.ContactType` from literal data (datalines) and then appends it to a...

View code
Macro
Macro Management and Exploration via SAS Catalog

This SAS script defines, stores, copies, and lists macros contained within a SAS macro catalog.

View code
ETL
Table creation and column filtering

Script creating a table with dynamic variable selection and displaying the result.

View code
ETL
Case Management in SAS String Comparisons

This SAS script demonstrates different methods of managing case during string comparisons to assign a status based on...

View code
Macro
Simple Macro Definition and Call

This SAS script defines a simple macro named 'test' that creates an empty dataset 'test'. The macro is then called. I...

View code
ETL
Calculation of New Columns and Formatting

This program uses a DATA step to create a new table from SASHELP.CARS, by filtering data, calculating new columns, ap...

View code
Utility
Log and Output Cleaning

This macro resets the output, log, and ODS results windows in the SAS environment.

View code
ETL
Data Creation with Variable Filter and Display

Generation of a temporary table filtering variables by prefix, followed by its printing.

View code
Data Manipulation
Demonstration of the CHOOSEC function

Simple example of using the CHOOSEC function in a DATA _null_ step.

View code
Utility
Email Address Validation with PRXMATCH and FCMP

This SAS script validates email addresses using a custom `CheckMail` function defined with `PROC FCMP` and the `PRXMA...

View code
Macro
Numeric String Alignment Macro

SAS macro to vertically align character variables representing numbers based on separators (dot, comma, parenthesis).

View code
Macro
Variable Reordering / Selection Macro

Main SAS macro (`%chn_dt_ordvar`) designed to reorder a dataset by placing a specified set of variables at the beginn...

View code
Macro
Token Counting Macro

This SAS macro counts the number of tokens (words) in a given string, using a specified delimiter.

View code
Reporting
Orion Sales Reports and Sorting

This SAS script generates several reports and performs sorts on the `sashelp.Orsales` data table.

View code
Data Management
Attempt to modify SASHELP.Orsales

This script attempts to create or overwrite the system table `sashelp.Orsales` with a DATA step. It contains a `WHERE...

View code
Administration
Re-associating File Objects via SAS 9 Metadata

Administrative script designed to reassign file objects from an old directory to a new one in the metadata server.

View code

Derniers codes ajoutés

Boost Performance & Security: Creating Composite Indexes and Passwords with PROC DATASETS
This example illustrates the modification of two SAS data sets using the MODIFY statement and its sub-statements. It shows how to: modify SAS files, label a SAS data set, add a read password to a SAS data set, indicate the current sort order of a SAS data set, create an index for a SAS data set, assign informats and formats to variables, rename variables, and label variables in a SAS data set.
ETL
SAS Data Step Efficiency: When to Use Explicit OUTPUT vs. Implicit Rules
Writes the current observation to a SAS dataset.
Data Manipulation CAS
Stop Struggling with Data Ingestion: Efficiently Move CSVs to Memory with PROC CASUTIL
The CASUTIL procedure offers several table and caslib management functions, including displaying table metadata, deleting files, unloading and loading tables, promoting tables, and saving tables.
ETL CAS
Beyond the WORK Library: Mastering the 4 Default SAS Libraries You Must Know
This document describes the default SAS libraries: Work (temporary), User (user), Sashelp, and Sasuser. It explains their role and behavior within the SAS Viya 4 environment.
Data Access
Seamless Integration: How to Attach Data Step Outputs Directly to SAS Viya Jobs
The SAS Viya Platform File Service allows storing, retrieving, and deleting files kept in the SAS Infrastructure Data Server database repository. This repository is not considered a complete 'file system' but contains individual files directly accessible by their file identifier (UUID).
Administration
From SAS 9 to Viya: The Ultimate Guide to Migrating User-Defined Formats to CAS
In the SAS Viya platform, you can store user-defined formats in catalogs for use in a SAS session, or you can store them in a format library on the CAS server. Format libraries are associated with a CAS session, or they can be promoted to global scope to be available to all CAS sessions. User-defined formats in a format library are server-side formats that the server uses when an analysis is performed based on formatted values. You can migrate existing user-defined formats from SAS to the SAS Viya platform.
Tools CAS
Instant Performance Boost: Creating Indexes on the Fly with the INDEX= Data Set Option
Defines one or more indexes for a new output SAS data set.
Général
Stop Bloating Your Datasets: The Definitive Guide to Variable Selection with KEEP
Specifies variables to include in output SAS data sets.
ETL CAS
Combine and Conquer: Mixing Physical Paths and Existing Librefs in One LIBNAME Statement
Explains the concept of SAS library concatenation, allowing several libraries to be logically grouped under a single reference (libref).
Data Access
Stop Importing, Start Connecting: A Master Class in SAS/ACCESS Engines and SQL Pass-Through
This document provides examples of using SAS engines to access and process various types of external data, including delimited files, Excel files, databases (DBMS), XML, and JSON.
Data Access