Frequency Analysis with Internal Data and CMH Statistics
This SAS script creates a 'cmh' dataset from embedded data and then performs a frequency analysis and cross-tabulatio...
View code
Statistical
Frequency Analysis with Multi-Line Data
This SAS script reads data organized in multi-observation per line format via DATALINES to create the 'medicine' data...
View code
Macro
AHGdefault Utility Macro
Defines a utility macro to assign a default value to a specified macro variable if it is currently empty, with an opt...
View code
Macro
Macro AHGdim - Dimension Calculation
Utility macro calculating a dimension rounded up to the nearest integer, based on a count of elements divided by a fa...
View code
Administration
System write macro via XCMD
Macro writing a value to a text file via a system command.
View code
Macro
Comparison of Versioned Files AHGcmpWithSys
This SAS macro allows the comparison of two versions of a specified file, potentially managed by a version control sy...
View code
Macro
ahgD Delimiter Utility Macro
Macro conditionally inserting a delimiter.
View code
Macro
Getting the current date and time
Utility macro to get the current system date and time and store them in a specified SAS macro variable.
View code
Macro
Indirect macro variable resolution
Utility macro allowing indirect resolution of a macro variable.
View code
Macro
ahgarr List Element Extraction Macro
Utility macro to extract a specific element from a list stored in a macro variable.
View code
Macro
AHGbareName Macro
Utility macro to extract the 'bare name' of a dataset or file.
View code
Macro
Extracting the Base Name of a Dataset
Utility macro to extract the base name of a dataset, whether or not it is prefixed by a library.
View code
Macro
AHGblank Macro
Macro to check if a character string is empty or contains only spaces.
View code
Utility
Cleaning the WORK macro catalog
Macro to delete the compiled macro catalog in the temporary WORK library.
View code
Macro
Conditional addition of trailing slash
Utility macro to add a directory delimiter to the end of a path if necessary.
View code
Macro
Macro to add entry to CDARS system metadata
SAS macro to add a unique entry (identified by 'tot') to a metadata file (`reports.meta`), integrating version contro...
View code
Macro
AHGaddvars Macro: Adding and Formatting Variables
Utility macro to apply formats to a list of variables in a SAS table, creating these variables if they do not exist.
View code
Macro
Macro to add words after deletion
This utility macro combines deleting words from a phrase with adding new words to the end, using an internal macro %A...
View code
Macro
Age calculation from dates
This SAS macro calculates a person's age in full years based on their date of birth and a reference date. It takes in...
View code
Macro
Date Management with FCMP Functions
This SAS script defines and uses FCMP functions to manipulate dates by adding or subtracting months and years.
View code
Macro
Add a path to SASAUTOS
Concatenates a macro library to the sasautos path.
View code
Statistical
Adaptive Regression Analysis with Simulated Data
This SAS script simulates data according to a mixture model and then applies the ADAPTIVEREG procedure to perform ada...
View code
Macro
Conditional Utility Macro ahg0
Macro that returns a specific character string if an input parameter is empty.
View code
Macro
Conditional Execution Utility Macro
Macro executing a SAS statement if a specified parameter is not empty.
View code
ETL
Reading and Manipulating Date Variables with Datalines
This SAS script illustrates the reading and manipulation of date variables from internal data (datalines) using vario...
View code
ETL
Data Reading and Sorting Exercises (US Presidents & Pumpkin)
Exercise script illustrating different techniques for reading raw data (Column input, pointers) and sorting.
View code
Macro
Forced termination of SAS program (_ABEND)
This SAS script defines an _ABEND macro that allows a SAS program to be stopped depending on the execution environmen...
View code
Général
Sans titre
This SAS macro checks if a given path is absolute or empty. If the path is not absolute and not empty, it prefixes it...
View code
Statistical
Principal Component Analysis (ACECLUS) and Iris Data Clustering
Documentation example for the ACECLUS procedure, performing cluster analysis on Fisher's Iris data.
View code
Reporting
Combined Chart with GBARLINE
This SAS script generates a combined chart (bars and lines) from the SASHELP.PRDSALE table and exports the result in ...
View code
Administration
Massive addition of groups in SAS 9 metadata
Administration script to add all existing user groups to a target parent group via the metadata server.
View code
Administration
Automatic Server Context Assignment (SAS 9 Metadata)
Administration script interacting with a SAS 9 metadata server to assign an application server context (SASSTP) to a ...
View code
ETL
Simple Data Creation and Transformation
Basic example of data creation, variable calculation, and display.
View code
Reporting
Report Launch Web Interface Generation
Script generating an interactive HTML page to launch a SAS report with dynamic parameters based on data.
View code
ETL
Advanced Inventory and Purchase Data Manipulation
This SAS script demonstrates fundamental and advanced data manipulation techniques. It includes creating datasets, ap...
View code
ETL
Copying data from an ODBC source to local files
This SAS script copies tables from an ODBC data source (`dwdata`) to SAS files located on a local path (`dwRaw`).
View code
Statistical
Assignment of experimental units and dataset operations
This SAS script demonstrates methods for assigning experimental units (subjects) to treatment groups in a balanced an...
View code
ETL
Sans titre
This SAS script creates a dataset of student scores, sorts it, and identifies duplicate scores, retaining the highest...
View code
Statistical
Analysis of Weight Difference Before and After a Diet
This SAS script performs a paired t-test to evaluate the weight difference before and after a diet, based on data dir...
View code
Reporting
Terminology Graph - Systolic Pressure
This SAS script generates a distribution graph of systolic blood pressure using PROC TEMPLATE and PROC SGRENDER. It i...
View code
ETL
Creation of the MYLIB.CLASS1 table
This SAS script creates a table named CLASS1 in the MYLIB library using instream data (datalines).
View code
ETL
Explanation of PROC IMPORT
This document explains in detail the use of the PROC IMPORT procedure to import data from various external sources in...
View code
ETL
Converting character string to numeric value
Script demonstrating the conversion of a character variable containing separators to numeric format.
View code
Graphical Reporting
Characteristics of Subjects in the Study
This SAS script generates a detailed panel graph displaying subject characteristics from the `sashelp.heart` dataset....
View code
ETL
Student Data Management with Sorting and Deduplication
This SAS script creates a 'CLASSTEST' table from embedded data, then generates a new table 'CLASSTEST_SORT' containin...
View code
Data Manipulation
Substring Extraction
This SAS script demonstrates the use of the SUBSTR function to extract a substring from a text variable in a DATA ste...
View code
ETL
Creating and Displaying an In-Stream Dataset
This SAS script creates a dataset named 'instream_mtcars' from in-line provided data and then displays its content.
View code
Statistical
Zero-Inflated Poisson GLOMM Model
This SAS script generates data following a Zero-Inflated Poisson Generalized Linear Mixed Model (GLOMM), then estimat...
View code
Statistical
ZINB GLOMM Simulation and Analysis
Generation of simulated data for a zero-inflated negative binomial generalized linear mixed model and parameter estim...
View code
ETL
Simple Data Creation and Filtering
Demonstration script creating an internal table and displaying a subset.
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.