Macro deleting all numbered 'sasmacr#' catalogs in the WORK library, without deleting the main 'sasmacr' catalog.
View code
Utility
SAS Tables Deletion Demonstration
This script illustrates the use of the `%delete_dataset` macro to delete SAS tables in various ways.
View code
Macro
Delete entries from a graphics catalog
This macro deletes specific entries or all entries from a SAS graphics catalog.
View code
Reporting
Density Plot with PROC SGPLOT
This script generates density plots to visualize the distribution of numerical variables using the SGPLOT procedure.
View code
Administration
Definition and Management of User-Defined CAS Actions
This SAS script defines and manages User-Defined Actions (UDAs) for SAS Cloud Analytic Services (CAS), enabling detai...
View code
Macro
Macro Variable Existence Check (Defined)
Macro checking if a macro variable is defined in the global environment.
View code
Macro
Macro variable existence check (defined)
Macro function that determines if a specific macro variable is defined in the global environment.
View code
Général
Sans titre
Utility macro to define macro variables containing the character strings for NOTE, WARNING, and ERROR messages in the...
View code
Test
Test of the _detectSymbols macro
This SAS script is a unit test for the `_detectSymbols` macro, verifying its ability to correctly set global symbols ...
View code
Macro
Macro _DIRCHAR for directory character
This macro returns the appropriate directory separator character for the operating system.
View code
Administration
Listing System Drives via DRIVEMAP
This script attempts to list the drives accessible to the operating system using the specific DRIVEMAP facility.
View code
Macro
DROPMISS Macro - Deleting Empty Variables
SAS macro to delete variables from a table that contain no data (only missing values).
View code
Administration
External File Deletion Macro
SAS macro to delete an external file if it exists, using the system functions filename and fdelete.
View code
Macro
Deletion of Temporary Datasets
Utility macro to delete specific temporary datasets (starting with 'DATA') from the WORK library.
View code
ETL
Investment Simulation over 5 Periods
Calculation of the future value of investments over 5 iterations via a loop.
View code
ETL
Demonstration of DO loops in SAS
This script illustrates the difference between repetitive manual calculation and the use of a DO loop for iteration i...
View code
Administration
File Listing via System Pipe (Windows)
Execution of a system command to list files in a directory and loading the result into a SAS table.
View code
Administration
SAS Viya CAS Environment Information
This SAS Viya script provides detailed information about the Cloud Analytic Services (CAS) environment, including the...
View code
Function
Creating custom functions for weekdays
Script defining two custom functions via PROC FCMP to get the name or number of the weekday from a date.
View code
ETL
Date and Time Manipulation and Formatting
This SAS script demonstrates the creation, manipulation, and formatting of date and time variables, as well as the us...
View code
ETL
Date component extraction and manipulation
Script illustrating the extraction of temporal elements (day, month, year, quarter, weekday) from a date variable.
View code
ETL
Dataset creation with heterogeneous dates
Example of reading dates in different formats (text, numeric) in a DATA step.
View code
Macro
DeBlackHole Debug Macro
Utility macro designed to reset the SAS interpreter in case of persistent syntax errors (open quotes, unclosed commen...
View code
Macro
DBMSlist Macro - Batch Database Querying
SAS macro designed to query a relational database using values from a SAS dataset as filtering criteria, processed in...
View code
Macro
SAS Table Existence Assertion Macro
Utility macro used in unit tests to verify the existence (or non-existence) of a given SAS table and raise an asserti...
View code
Macro
Temporary File Name Generation
Macro to create a unique temporary file name in a specific folder.
View code
Général
Sans titre
This SAS script creates an initial dataset 'b' from in-line data, then transforms this dataset into 'newdata' by addi...
View code
ETL
Implementation and Comparison of the '_INFILE_' Technique for Data Delimitation
This SAS script demonstrates and compares two methods for delimiting complex character strings into multiple variable...
View code
Macro
Dynamic CSV export macro csv_vnext
Utility macro to export a SAS dataset to a delimited file (CSV) using a DATA _NULL_ step and the CALL VNEXT routine t...
View code
Macro, ETL
CSV File Import Macro
Generic SAS macro for importing CSV files into the SAS workspace.
View code
Macro
SAS Macro for Centered Title with Form Feed
This SAS macro creates a centered page title and adds a form feed character at the far right (FFx).
View code
Macro
Numeric variable categorization macro (cut)
This SAS macro categorizes a numeric variable into user-defined classes (bins). It creates a new variable containing ...
View code
Macro
Space Cleaning Command Macro
Command-type macro to replace multiple spaces with single spaces.
View code
Utility
SAS Macro _DATA: Extracting Table Name
This SAS macro extracts the name of a table from a complete reference (library.table) or a simple one, ignoring the l...
View code
Macro
Test Macro for Cross-Referencing
Test macro designed to demonstrate and validate the cross-referencing functionality of macro calls within the SASUnit...
View code
Macro
Cross-reference Test Macro
This SAS macro, named 'CrossReferenceTest2', is a component of the SASUnit test framework. It creates a temporary dat...
View code
Macro
Test macro for cross-referencing
Simple test macro to demonstrate cross-referencing and numerical parameter evaluation.
View code
Statistical
Analysis of PhDs Awarded
This SAS script performs a correspondence analysis on the data of the number of PhDs awarded in different scientific ...
View code
Macro
Creation of EXA Test Data Table
Macro to create the EXA test database table for the SASUnit framework.
View code
Général
Sans titre
SASUnit macro to create the 'scn' table containing information about test scenarios.
View code
Macro
TSU Test Data Table Creation Macro
SAS macro to create a test data table named 'tsu' in a specified library. This table is used to store test parameters...
View code
Macro
Pre-processing macro for a unit test
This macro prepares the environment for test execution. It cleans up previous test artifacts, inventories existing ma...
View code
ETL
DATA Step Partitioning and Sorting in CAS
Example of optimizing data loading into CAS with partitioning and sorting, followed by group processing.
View code
Web Service
DataGridProvider
Stored Process generating a paginated JSON response from a SAS table to feed a web interface (grid type).
View code
Général
Sans titre
This SAS script creates a dataset containing various representations of dates and times, including a specific date an...
View code
Test
Test of the _createScnLogConfigTemplate macro
This script is a SASUnit test case for the utility macro `_createScnLogConfigTemplate.sas`. It verifies the correct c...
View code
Macro
Creation of the test database
Creates a test database for the SASUnit framework.
View code
Macro
Creation of the SASUnit test case table
Macro creating the 'cas' table intended to store test case metadata and results within the SASUnit framework.
View code
Reporting
Custom ODS Style Definition
This SAS script defines a new custom ODS (Output Delivery System) style named 'customSapphire'. It inherits from the ...
View code
Data Management
Creating a format for cylinders
Definition of a custom format for the textual display of the number of cylinders.
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.