Test macro generating an event if a specified SAS table exists.
View code
Macro
Macro assert_not_fileexist - Assertion for file absence
Generates an event if a specified file exists, used to validate that a file should not be present.
View code
Macro
Macro assert_not_null - Non-Nullity Assertion
Test utility macro generating an event if the specified argument is null or has zero length.
View code
Macro
Macro assert_not_zero - Non-nullity Assertion
Generates an event (error/alert) if the argument value is equal to zero.
View code
Macro
Macro assert_null - Non-null value assertion
Test macro checking if an argument is not null and generating an event accordingly.
View code
Macro
Macro assert_zero - Null Value Assertion
Unit test macro checking if a given value is equal to zero and generating an event in case of failure.
View code
Macro
assertManual Macro
SAS Macro for handling manual assertions in the SASUnit testing framework.
View code
Reporting
Generating Stacked Area Plot with SGPLOT
Generates a stacked area plot exported as HTML and PNG.
View code
Graph
100% Stacked Area Plot
This SAS script generates a 100% stacked area plot using internally created data. It calculates percentages for each ...
View code
ETL
Merging datasets and creating reports
This SAS script creates two datasets, sorts them, then merges them in different ways (standard, inner, outer). The re...
View code
Général
Sans titre
This macro deletes a set of macro variables created according to an 'array' scheme (e.g., prefix1, prefix2, ..., pref...
View code
Général
Sans titre
Test macro verifying that a SAS table contains no observations. It generates an event if the table contains data.
View code
Macro
Macro assert_exist - Table existence verification
Unit test macro verifying the existence of a SAS table and generating an event in case of failure.
View code
Général
Sans titre
Validation macro that checks for the existence of a fileref and generates an event in case of failure.
View code
Macro
Sans titre
Unit test macro verifying the presence of a physical file and generating an event if it is absent.
View code
Macro
Substring Extraction After Target Character
SAS functional macro to extract the part of a string located after the first occurrence of a target character.
View code
Macro
Allocation Macro for Read-Only Libraries (allocr)
Example macro to allocate data and format libraries in read-only mode for a specific clinical study (Spectre Clinical).
View code
Configuration
Display Options Configuration
Configures global SAS session options for output formatting.
View code
Statistical
Analysis of Variance for a Randomized Complete Block Design
This SAS script performs an Analysis of Variance (ANOVA) for a randomized complete block design with a factorial trea...
View code
Statistical
Example 2 for PROC ANOVA: Multiple Comparisons
Example of using PROC ANOVA to analyze the nitrogen content of red clover plants inoculated with different bacterial ...
View code
Statistical
Analysis of variance of a split-plot design
This SAS script illustrates the use of PROC ANOVA to analyze a split-plot design, based on Example 3 from the PROC AN...
View code
Statistique
ANOVA Analysis for Sugar Beet
This SAS script performs an Analysis of Variance (ANOVA) on sugar beet data, using a latin square split-plot experime...
View code
Statistical
ANOVAIN1
Introductory example for one-way analysis of variance (One-Way ANOVA) with PROC ANOVA, analyzing the nitrogen content...
View code
Statistical
Analysis of Variance: Randomized Complete Block Example
This SAS script performs an Analysis of Variance (ANOVA) for a randomized complete block design with a single factor,...
View code
ETL
SAS Data Concatenation and Appending Techniques
Comparative demonstration of three methods to concatenate datasets: Data Step, Append Procedure (encapsulated in a ma...
View code
Macro
AHGwt Macro - Writing to a file
Utility macro to write a specific character string to a text file.
View code
Macro
AHGzero Macro for Numeric Formatting
This macro formats a given number into a character string of a specified length, using the %SYSFUNC(PUTN()) function.
View code
Macro
Formatting Macro for Clipboard
SAS Macro to read clipboard content, format it, and save it to a text file for Microsoft Word.
View code
Macro
Decimal Point Alignment Macro (aligndp.sas)
This SAS macro, designed for use in a DATA step, formats a numeric variable into a character variable by aligning dec...
View code
Reporting
Code Diary Documentation Generation
Orchestration script generating project documentation in Markdown and HTML format.
View code
Macro
Macro allafter
This function-style macro returns the part of a character string that follows the first occurrence of a given target ...
View code
Macro
AHGwhere Utility Macro
Macro systematically returning the value 1, likely acting as an 'always true' condition.
View code
Macro
Operating System Detection (Windows/Unix)
Utility macro to determine if the SAS execution environment is Windows or Unix.
View code
Macro
Windows Temporary Path Macro
Macro defining a Windows-specific temporary directory path.
View code
Macro
Word Relationship Management
This SAS macro manages word relationships by storing and deduplicating them in a SAS table 'allstd.wordtowords'.
View code
Macro
AHGuncompress Macro - Character Retention
Utility macro that allows retaining only specified characters in a text string, acting as a positive filter.
View code
Macro
AHGuseLabel Macro - Variable Renaming by Label
This SAS macro allows renaming variables in a dataset using their label as the basis for the new variable name. It in...
View code
Macro
User Path Definition Macro
Defines a macro that returns a network path specific to the current user.
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 ManipulationCAS
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.
ETLCAS
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.
ToolsCAS
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.
ETLCAS
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.