Checking for variable existence in a dataset (mf_existvarlist)
This macro checks if all variables specified in 'varlist' exist in a given SAS dataset referenced by 'libds'. It retu...
View code
Macro
String Deduplication
Macro to remove duplicates from a string based on a specified delimiter.
View code
Général
Sans titre
Macro to display a message in a standardized JavaScript alert box within a SAS web application.
View code
Statistical
Descriptive Statistics Macro (Means/Median)
SAS macro calculating and formatting descriptive statistics (mean, standard deviation, median, IQR) for continuous va...
View code
ETL
Difference Table Creation and Indexing Macro
This SAS macro creates or updates the structure of a SAS table (`DIFFTABLE` by default) intended to store information...
View code
Statistical
Analysis of Flying Mileages Between Ten U.S. Cities with PROC MDS
Introductory example to the MDS (Multidimensional Scaling) procedure using mileage data between cities.
View code
Statistical
Example of using the REOBSINFO option in PROC MCMC
This SAS script illustrates the use of the MCMC procedure with the REOBSINFO option. It generates a simple input data...
View code
Statistical
Example of Multivariate Distribution Usage
This script generates multivariate normal data using PROC IML, then fits a Bayesian multivariate normal model using P...
View code
Statistical
Regenerating Diagnostic Plots
This script performs a Bayesian MCMC analysis on the `sashelp.class` dataset and then generates diagnostic plots for ...
View code
Statistical
Sans titre
This SAS script implements a simple Dynamic Linear Model (DLM) using the MCMC (Markov Chain Monte Carlo) procedure fo...
View code
Statistics
Simulation of Gamma and Inverse-Gamma Priors
Simulates Gamma and Inverse-Gamma prior distributions using the SAS MCMC procedure.
View code
Statistics
Random Effects Model with PROC MCMC
Getting Started Example 3 for PROC MCMC, implementing a random effects model for height data analysis.
View code
Statistical
Introduction to PROC MCMC Example
This script illustrates an introductory example of using the PROC MCMC procedure for Bayesian regression analysis, mo...
View code
Statistical
PROC MCMC Getting Started Example 2: Behrens-Fisher Problem
Example illustrating the use of the MCMC procedure to solve the Behrens-Fisher problem (comparison of means of two no...
View code
Statistical
Random Effects Logistic Regression Model
This SAS script uses the MCMC procedure to fit a Bayesian logistic regression model with random effects, demonstratin...
View code
Statistical
Create Design Matrix for Bayesian Analysis
This SAS script prepares categorical data for Bayesian analysis by creating a design matrix. It uses internal data to...
View code
Statistics
Poisson Regression with PROC MCMC
Example of Poisson regression using PROC MCMC and comparison with PROC GENMOD.
View code
Statistical
Caterpillar Plot with PROC MCMC
This SAS/STAT example script illustrates the use of the MCMC procedure to fit a Bayesian logistic model with random e...
View code
Général
Sans titre
SAS macro that defines an FCMP function to calculate the minimum display length of a numeric value.
View code
Macro
Detecting Maximum Indices of Titles and Footnotes
Utility macro to identify the highest numbers used for titles and footnotes in the current SAS session.
View code
Reporting
Generating Scatterplot Matrices with PROC SGSCATTER
This SAS script generates multiple scatterplot matrices using the PROC SGSCATTER procedure. It uses the built-in 'sas...
View code
ETL
Analysis and merging of corporate and financial data
This SAS script creates and manipulates two internal datasets ('company' and 'finance') from in-line data, then merge...
View code
Macro
Loading Macro Library from GitHub
Initialization script that dynamically downloads and compiles a suite of SAS macros from a public GitHub repository.
View code
Macro
Macro Marvel Messages
SAS macro displaying superhero quotes in the log.
View code
Finance
Martin_Ratio Macro
SAS macro calculating the Martin Ratio to evaluate the risk-adjusted performance of a portfolio.
View code
Macro
Markcode Macro - Interactive Execution and Visualization (Legacy)
Utility macro designed for classic interactive SAS environments (Display Manager) to submit buffer code and open the ...
View code
Macro
Macro markdsn - Interactive table opening
Utility macro designed to open a SAS table (dataset) whose name is stored in the system clipboard. Uses interactive c...
View code
Macro
Creating and Assigning a Temporary Library
This macro checks for the existence of the 'c:\tempwork' directory and creates it if necessary on a Windows system, t...
View code
Macro
SDTM Date Creation --DTC
This SAS macro generates an SDTM-formatted date variable (--DTC) from date and time components provided as separate S...
View code
Macro
Macro Variable Manipulation and Data Creation
This SAS script demonstrates the creation of an internal dataset and the use of various macro functions to manipulate...
View code
Macro
Path Test Macro
Analysis and demonstration of using the %SYSFUNC(DEQUOTE) macro to handle character strings with or without quotes.
View code
Macro
Print and Frequency Test Macro
This SAS script defines a global macro variable and a macro to display version information and execute a simple frequ...
View code
Macro
Deletion of compiled macros
Utility macro to delete compiled macros from the current session (WORK library).
View code
Macro
Sans titre
Provides a %mabbrev macro-function that mimics REXX's 'abbrev' function, allowing to check if one string is a valid a...
View code
Macro
Generic Utility Macro m_utl_xxx
Utility macro for a generic function. Provides a brief and detailed description of the macro's function.
View code
Macro
m_val_xxx Validation Macro Skeleton
Basic structure for a validation macro with integrated Doxygen documentation.
View code
Macro
m_uc_xxx Macro Definition Template
This file is a standardized template for creating SAS macros, including a detailed documentation structure.
View code
Général
Sans titre
Code skeleton for a standardized system macro, including documentation headers and common parameters.
View code
Macro
Logging Macro m_log_xxx
SAS macro skeleton for logging, containing only the definition structure and documentation.
View code
Macro
Generic header macro m_hdr_xxx
Standardized header macro for SAS scripts, facilitating documentation and parameter management such as help and debug...
View code
Macro
Macro template m_cst_xxx
Definition skeleton for a custom SAS macro, including standardized header documentation.
View code
Macro
Interactive Input via Macro Window (Legacy)
Defines and attempts to display a textual interactive window for parameter input.
View code
Macro
SAS CALC Macro for Descriptive Analysis
This SAS macro, named CALC, validates variables in a specified dataset and executes the PROC MEANS procedure on valid...
View code
Macro
SAS Variable Name Cleaning and Normalization
This SAS script illustrates three implementations of a '%fixname' macro, whose objective is to clean and normalize ch...
View code
Dynamic Programming
Dynamic Execution with CALL EXECUTE
Illustration of using the CALL EXECUTE routine to dynamically execute SAS code from a DATA step.
View code
Utility
Dynamic Macro Execution on Metadata
Script dynamically generating macro calls for tables whose name contains a specific pattern.
View code
Macro
Simple Conditional Macro
This SAS script defines and uses a simple macro that takes a parameter and displays a corresponding company name base...
View code
Macro
Company Name Display Macro
This SAS macro displays the full name of a company based on an abbreviation provided as a parameter in the SAS log.
View code
Macro
Company Greeting Macro
This macro displays a company name or a generic phrase in the SAS log based on the provided argument.
View code
Macro
Secure extraction of the first character of a macro variable with %SUPERQ
Demonstrates the importance of the %SUPERQ macro function for manipulating strings containing special characters in t...
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.