Reporting
Overlaying two 3D surfaces with PROC G3D and GREPLAY

SAS script that generates and overlays two 3D surfaces using SAS/Graph's G3GRID, G3D, and GREPLAY procedures, then ex...

View code
Reporting
Creating an ODS document with multiple outputs

This script illustrates the creation of an ODS document containing multiple reports and a graph. It prepares data fro...

View code
Administration
Orphan Foreign Key Cleanup in Metadata

Identifies and, optionally, deletes foreign keys (ForeignKey) that do not have a 'PartnerUniqueKey' association in SA...

View code
Macro
Deleting Macros from work.sasmacr Catalog by SQL Pattern

Macro to delete macros from the work.sasmacr catalog using a user-specified SQL search pattern.

View code
Macro
Utility Macro for Truncating a SAS Table

SAS macro that deletes all observations from a table while preserving its structure, indexes, and integrity constraints.

View code
Administration
Unlock a SAS Dataset

Utility macro to remove the lock on a SAS dataset.

View code
Utility
Stop Hardcoding Filenames: How to Dynamically List Directory Contents in SAS

This SAS macro allows listing the names of all files in a specified folder location. It can either display the file n...

View code
Administration
Netezza Database Schema Modification for CI360

This script modifies the structure of the Common Data Model (CDM) for CI360 on a Netezza database to align with 'Sche...

View code
Macro
commaparms - Add commas to macro parameters

Function-style macro to reinsert commas between macro parameters in a character string.

View code
Connectivity
Configuring and Connecting to a Remote SAS Session

This SAS script configures encryption options, displays local system information, then establishes a connection to a ...

View code
Administration
Mastering Hybrid SAS: How to Orchestrate SAS/CONNECT and CAS Sessions

This SAS script establishes and manages SAS/CONNECT and CAS sessions on a SAS Viya environment. It demonstrates local...

View code
Administration
CAS Session and Connect Management and Data Creation

This SAS script configures and manages a CAS session and a SAS/CONNECT session for code execution both locally and on...

View code
Administration
Copying Members Between SAS 9 Metadata Groups

SAS 9 script to extract members from one metadata group and add them to another. This script is specifically for SAS ...

View code
Reporting
Creating an ODS Tagset to Count Event Frequency

This SAS script defines a custom ODS tagset, 'tagsets.counter', which counts the frequency of each ODS event during a...

View code
Statistical
Confirmatory Factor Analysis with PROC CALIS

Example of confirmatory factor analysis using PROC CALIS on cognitive abilities data. The script defines and tests tw...

View code
Statistical
Example 25 for PROC CALIS - Latent Growth Curve Model

This SAS script uses the CALIS procedure to fit latent growth curve models, demonstrating longitudinal data analysis.

View code
Statistical
Example of Confirmatory Factor Analysis with PROC CALIS

This script performs a confirmatory factor analysis using the CALIS procedure to model the relationship between obser...

View code
Statistics
Example of Confirmatory Factor Analysis with PROC CALIS

This script illustrates the use of the CALIS procedure to perform confirmatory factor analyses with different model s...

View code
Statistical
Categorical Data Analysis with PROC CATMOD

This SAS script performs a logistic regression analysis on categorical data from a detergent preference study using t...

View code
Statistics
Example 5 for PROC CATMOD: Log-Linear Model

Analysis of squirrel monkeys' behavior using a log-linear model for an incomplete contingency table, employing the CA...

View code
ETL
Data Processing and XML Export

This SAS script defines a default data source, retrieves metadata about this source, then exports its content in XML ...

View code
Macro
SAS Macro for Table Version Retrieval (`AHGtabver`)

This macro allows retrieving the version number of a table or component by executing an external system command (`tab...

View code
Statistic
Correlation and Regression Analysis on Socio-Economic Data

This SAS script performs a series of statistical analyses on socio-economic data. It creates a data table, calculates...

View code
Macro
Assertion of a Non-Empty Dataset

Generates an event if a specified dataset does not exist or is empty (contains no observations).

View code
Statistical
Example Documentation 1 for PROC BCHOICE

This SAS script demonstrates the use of PROC BCHOICE to analyze discrete choice data, exploring alternative-specific ...

View code
Statistical
Covariance Structure Analysis with PROC CALIS

This script illustrates the use of the CALIS procedure to perform a direct covariance structure analysis on a COV typ...

View code
Macro
Utility macro to determine the extension of SAS catalogs

Macro that determines the SAS catalog file extension (.sas7bcat, .sc2, etc.) based on a SAS version number provided a...

View code
Macro
Macro _COUNT: Count Elements in a List

A SAS macro that counts and returns the number of individual elements in a list of values.

View code
Macro
Macro to check for dataset existence

This macro, _dsexist, returns 1 (true) if a SAS dataset exists and 0 (false) otherwise. It includes specific handling...

View code
Administration
Updating Server Contexts for SAS Libraries

Administration script for SAS 9 that associates an application server context (e.g., SASSTP) with a set of SAS librar...

View code
Macro
Macro to display a dataset

SAS Macro that encapsulates the PROC PRINT procedure to display the content of a dataset with formatting options.

View code
Reporting
Tumor Size Change Graphs (Waterfall Plot)

This script generates data simulating tumor size variation and creates two 'waterfall plot' bar charts with PROC SGPL...

View code
Reporting
Controlling the Sort Order in a Frequency Report

This program uses the ORDER= option of the TABLES statement in the FREQ procedure to control the sort order of the re...

View code
Macro
Post-generation analytical graph annotation

Script demonstrating an advanced technique to add custom annotations to a graph generated by an analytical procedure ...

View code
ETL
Creating and Displaying School Grade Data

This SAS script illustrates basic operations of creating data tables via DATALINES, calculating new variables, modify...

View code
Statistical
Linear Regression Analysis and Visualization

This script performs two distinct linear regression analyses. The first examines the relationship between alcohol con...

View code
Statistical
Nonlinear Regression for Patient Prognosis

This script performs a nonlinear regression to model the relationship between the number of hospitalization days and ...

View code
Statistical
Descriptive analysis of categorical variables

This SAS script performs a descriptive analysis of numerical and categorical variables using PROC PRINT, PROC SQL, an...

View code
Statistical
Calculating the Kappa Coefficient for Movie Ratings

This SAS script calculates and compares the Kappa concordance coefficient for movie rating data using PROC FREQ and a...

View code
Statistical
GEE Analysis of Ordinal Shoulder Pain Data

This SAS script analyzes data from a Shoulder Tip Pain study using GEE (Generalized Estimating Equations) models for ...

View code
Statistical
Homogeneity Test for Aggregated Trinomial Results

This SAS script simulates aggregated (clustered) trinomial data for two products, then applies statistical procedures...

View code
Statistics
Survival Analysis with Curves and Risk Tables

This script performs a survival analysis on SASHELP.BMT data, generates survival curve data via PROC LIFETEST, then u...

View code
Général
Sans titre

This SAS script demonstrates the use of the ODBC data connector in SAS Viya 4 to access column metadata for a CAS tab...

View code
ETL
Loading Data with CAS Connector (Example)

This SAS script demonstrates how to use the SAS data connector to load data from an external relational database mana...

View code
Général
Sans titre

Utility script to extract and display the absolute path and name of the currently executing SAS file.

View code
Graphic Utility
Setting Graphic Parameters for PDF Output

The PDF macro initializes SAS/GRAPH to produce PDF output. It defines the output file name based on the SASFILE or GS...

View code
Data Management
Creating Custom Format for Cylinders

Definition of a library and creation of a value format for cylinders.

View code
ETL
Example of DATA STEP usage with PROC APPEND

This SAS script illustrates table creation and deletion, particularly managing dependencies when creating tables from...

View code
Graphic
Generating Graphic Symbol Definitions

Dynamically generates SAS/GRAPH SYMBOL statements from a predefined list for parallel coordinate plots.

View code
Macro
String Analysis Macro

This SAS macro allows you to split a character string into words or phrases according to specified delimiters, and th...

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