Macro
AHGsome Utility Macro

Defines a utility macro called AHGsome, which checks if a given character string is not empty using the internal macr...

View code
Statistical
AHGstatfreqvert Macro: Frequency and Statistics Calculation

Macro to calculate vertical frequencies and other statistics on a given variable, with formatting options and missing...

View code
Statistical
AHGstatfreqvertby Stratified Frequency Macro

Macro calculating statistical frequencies for a given variable, stratified by a grouping variable (BY), with layout o...

View code
Statistical
Descriptive Statistics Calculation Macro AHGstatmeans

SAS macro calculating customizable descriptive statistics (n, mean, median, etc.) for a given variable with formattin...

View code
Statistical
Macro AHGstats_vertical - Calculation and Formatting of Statistics

SAS macro to calculate descriptive statistics on a variable, with formatting and transposition options.

View code
Macro
AHGsubsetdsn In-place Filtering Macro

SAS macro to filter an existing dataset, replacing it with a subset based on a globally provided condition.

View code
Macro
String Normalization Macro AHGtabnoStr

Utility macro to replace dots and spaces with underscores in a character string.

View code
Macro
AHGtag Macro

Utility macro for generating simple HTML or XML tags.

View code
Macro
AHGscanxy Macro for Substring Extraction

This utility macro extracts a specific element from a character string using coordinate-based (x, y) scanning logic.

View code
Général
Sans titre

SAS macro for sending and recording personalized messages or log information into a specific dataset.

View code
Administration
Dynamic SAS Environment Configuration

This macro dynamically configures SAS session options, including search paths for autocall macros (sasautos) and form...

View code
Macro
AHGsetprint Macro: Merging and Formatting SAS Tables

Macro for combining (stacking) multiple SAS tables while standardizing variables to character format for easier displ...

View code
Macro
Definition of the AHGshortpath macro

Definition of a SAS macro named AHGshortpath. Currently empty.

View code
Macro
Macro AHGRTFtotxt - RTF Conversion and Parsing

Utility macro designed to convert an RTF file into a flat text file or a SAS dataset. It cleans RTF formatting tags a...

View code
Macro
RTF to Text File Conversion

SAS macro to convert an RTF file to a plain text file by cleaning up formatting tags.

View code
Macro
Macro to configure Autocall macro paths

SAS macro that dynamically configures the SASAUTOS system option to define autocall macro search paths based on the e...

View code
Macro
Definition of the AHGsavecommandline macro

Definition of an empty SAS macro with parameters.

View code
Macro
AHGsavedsn Macro - Table backup with suffix

Macro for duplicating a SAS table by adding a suffix to the output table name.

View code
Macro
Nested String Parsing Macro

Utility macro for extracting substrings from a string with nested delimiters.

View code
Macro
Random String Generation

This SAS macro generates a random string of uppercase letters (from A to X) of a specified length. It can be used to ...

View code
Général
Sans titre

Macro to execute a shell command on a remote server via SAS/CONNECT and retrieve the result into a local macro variable.

View code
Macro
AHGprocMeansBy Macro - Statistics by segments

Utility macro to calculate statistics on data segments (defined by a 'by' variable) and consolidate the results.

View code
Macro
PROC PRINT Macro for Printing

This macro simplifies the use of PROC PRINT for printing datasets.

View code
Macro
AHGPtoL Display Macro

Simple macro displaying the content of a parameter in the SAS log.

View code
Macro
SAS Pure Table Name Extraction (AHGpureName Macro)

Utility macro to extract the root name of a SAS table, ignoring dataset options (such as WHERE or KEEP/DROP filters i...

View code
Macro
ahgputc Macro: INPUT Conversion with Default Format

Utility macro applying the INPUT function to a variable with automatic default format management.

View code
Macro
Format application macro and left alignment

Utility macro to format a variable and left-align the result.

View code
Graphic
IFS Christmas Tree Generator

This script generates a fractal Christmas tree using an Iterated Function System (IFS) implemented with PROC IML, the...

View code
Macro
Macro _begin for IN: operator

SAS _begin macro that generates a list of items for the IN: operator, designed to replace the %_in macro and handle c...

View code
Macro
Macro _BIN: Generating IN Operators

Utility macro designed to generate lists of values for the IN() operator in a more robust way than %_IN().

View code
Général
Sans titre

Utility macro designed to generate robust WHEN(...) statements containing long lists of values or ranges, used within...

View code
Reporting
Code Diary Documentation Generation

Script orchestrating the creation of a Code Diary and its conversion to HTML format.

View code
Macro
Runtime Environment Verification (_checkRunEnvironment)

Validation macro checking if the operating system and SAS version are supported.

View code
Test
Test of the _checkRunEnvironment.sas macro

This script is a unit test for the SAS macro `_checkRunEnvironment.sas`, which is part of the SASUnit testing framewo...

View code
ETL
Data Creation and WORK Library Management

The script creates a temporary SAS dataset named THREEROWS and executes PROC DATASETS on the WORK library.

View code
Data Management
Creation of format for US states

Definition of a custom format associating numeric codes with state names.

View code
Data Management
Definition of Custom Formats for States and Sex

Creation of two SAS formats to convert numeric codes into explicit labels.

View code
Data Manipulation
Monetary Data Formatting

Script for creating a cost table and applying a monetary format.

View code
ETL
Applying COMMA Numeric Format

Creation of a dataset and application of a thousands separator format.

View code
ETL
Creation and formatting of monetary data

Creation of a table with formatted monetary values and metadata analysis.

View code
ETL
BMI Calculation via Data Step

Simple Body Mass Index (BMI) calculation with output to the log.

View code
Reporting
Data Visualization with PROC CHART

This SAS script illustrates the creation of in-line datasets and the use of the PROC CHART procedure to generate vari...

View code
Utility
SAS Catalog Scan Utility

This macro allows exploring and printing the source content of a specified SAS catalog to a text file, then displayin...

View code
ETL
Creating and Displaying the CEREAL Dataset

This SAS script creates a `work.cereal` dataset using embedded data via `datalines`, then displays the content of thi...

View code
Administration
Management and Connectivity to the SAS/SHARE Server

This document describes examples of managing a SAS/SHARE server (starting, stopping) and accessing remote data via a ...

View code
Général
Sans titre

Examples of htmSQL scripts (legacy web technology) integrating SAS SQL results into HTML pages.

View code
Général
Sans titre

This SAS script uses the HTTP procedure to send an HTTP request to a web server. The request body is defined inline w...

View code
Configuration
Configuring SAS Log Colors (Legacy)

Customizing the colors of error and warning messages in the SAS log via Display Manager commands.

View code
Connectivity
Connect to Snowflake via LIBNAME

This script establishes a connection to a Snowflake database using a LIBNAME statement and the SAS/ACCESS interface.

View code
ETL
Creation of the THREEROWS table

Creation of a simple SAS table with data included in the code.

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