Data Manipulation

51 Résultats disponibles

Data Manipulation
SAS Data Step Efficiency: When to Use Explicit OUTPUT vs. Implicit Rules

Writes the current observation to a SAS dataset.

View code
Data Manipulation
Logic Traps: Mastering Operator Precedence and Parentheses in Complex SAS Filters

This document provides examples illustrating the use of the WHERE clause to conditionally select rows in SAS tables, ...

View code
Data Manipulation
Master & Transaction Logic: The Definitive Guide to Applying Sequential Updates in SAS

This document presents examples of using the UPDATE statement in SAS to modify a master dataset from the values of a ...

View code
Data Manipulation
Mastering BY-Group Processing: A Deep Dive into FIRST. and LAST. Variables in SAS

This document explains and demonstrates the use of automatic FIRST. and LAST. variables in the SAS DATA step for proc...

View code
Data Manipulation
Mastering Data Segmentation: The Definitive Guide to BY-Group Processing in SAS

This document provides examples illustrating how to process BY groups (BY-Groups) in a SAS DATA step. It covers the u...

View code
Data Manipulation
The 'Many-to-Many' Trap: Handling Duplicate Keys and Missing Values in SAS Merges

This document provides examples of match-merging SAS datasets using the MERGE and BY statements in a DATA Step. It co...

View code
Data Manipulation
Side-by-Side Data: Mastering Positional Merging with MERGE vs. Double SET Statements

This document presents examples of using the MERGE statement without the BY statement to perform one-to-one data merg...

View code
Data Manipulation
Read Less, Run Faster: Optimizing SAS Performance with KEEP, WHERE, and OBS

This document provides SAS code examples for controlling variables and observations when manipulating SAS datasets.

View code
Data Manipulation
Beyond the Basics: Using PARTITION and ALTERTABLE to Reshape CAS Data

This example uses three PROC CASUTIL statements to load, partition, and modify a data table in the SAS Cloud Analytic...

View code
Data Manipulation
Physical vs. Logical: Unlocking the Hidden Behavior of SAS Data Set Options

This example shows how to use the FIRSTOBS= and OBS= data set options with the WHERE statement to specify a segment o...

View code
Data Manipulation
Beyond the MERGE Statement: Mastering In-Memory Joins with SAS Hash Objects

This example illustrates the use of a hash table to merge two SAS datasets (one-to-many or many-to-many) using a comm...

View code
Data Manipulation
The Anatomy of a SAS Dataset: Understanding Metadata, Engines, and Storage Models

A SAS dataset is a collection of tabular data in a SAS file format, containing both data and metadata. This document ...

View code
Data Manipulation
Why Slower is Sometimes Better: Mastering the SINGLE=YES Option in SAS Viya

This document explains how to execute a SAS DATA step program in single-threaded mode within a CAS (Cloud Analytic Se...

View code
Data Manipulation
Mastering CAS Logic: How to Correctly Group Data in Descending Order Without Leaving CAS

This document explains how to group variables in descending order using the DATA Step BY statement, distinguishing it...

View code
Data Manipulation
Supercharge Your Lookups: Mastering Simple and Composite Indexes in the SAS DATA Step

Defines an index for a new output SAS data set.

View code
Data Manipulation
Fixing SAS Merge Errors: How to Standardize Attributes and Data Types

This document contains detailed examples on preparing and manipulating SAS data before combining it, addressing vario...

View code
Data Manipulation
How to Organize and Process SAS Datasets with BY Groups and PROC SORT

This document presents practical examples on how to group and process data observations using the BY statement in a D...

View code
Data Manipulation
How to Interleave SAS Datasets: Combining Data While Preserving Sort Order

This document provides examples illustrating how to interleave SAS datasets using the SORT procedure and the BY state...

View code
Data Manipulation
How to Filter SAS Data Faster: Mastering WHERE, KEEP, and Observation Options

This document provides practical examples on how to control which variables and observations are read and written whe...

View code
Data Manipulation
Beyond the DATA Step: How to Filter and Alter CAS Tables Faster with PROC CASUTIL

This example uses three PROC CASUTIL statements to load, partition, and modify a CAS table. It demonstrates how to lo...

View code
Data Manipulation
Faster Merging in SAS: Why Hash Objects Outperform Traditional Joins

This example illustrates the use of a hash table to merge two datasets sharing a common variable. The hash table is c...

View code
Data Manipulation
Mastering SAS In-Place Updates: How to Handle Complex Transactions with IORC

This example illustrates how to modify a master dataset by adding or updating observations from a transaction dataset...

View code
Data Manipulation
Cleaning SAS Datasets: How to Use the DROP Statement to Manage Variables

Excludes variables from output SAS datasets.

View code
Data Manipulation
Mastering SAS CAS: How to Dynamically Alter Table Labels and Formats with PROC CAS

This example applies labels and formats to columns of a CAS table using the ALTERTABLE action, then displays the form...

View code
Data Manipulation
Scalable Data Pipelines: Appending CAS Tables without Full Reloads via PROC CAS

This action allows you to append the rows of a source table to the end of an existing target table in a SAS Cloud Ana...

View code
Data Manipulation
Smart Partitioning: How to Filter and Append Large-Scale CAS Tables in One Step

This feature allows adding rows from a source table to an existing target table in CAS, using the 'WHERE' parameter t...

View code
Data Manipulation
SAS Viya Data Lifecycle: How to Upload, Persist, and Drop CAS Tables with PROC CAS

This script illustrates the actions of the 'table' action set in SAS Viya 4 for managing in-memory tables. It covers ...

View code
Data Manipulation
Stop Deleting Observations! How to Fix Missing Values in SAS without Biasing Your Model

This script illustrates the use of the MI procedure to perform multiple imputation on a dataset containing missing va...

View code
Data Manipulation
String Manipulation in SAS: How to Split File Paths Without Hardcoding

Macro-program to decompose an absolute file path into file name and parent path.

View code
Data Manipulation
Generating Current Temporal Variables

This script creates a table containing the current system date, time, and datetime.

View code
Data Manipulation
SAS Data Types in CAS

This document describes the data types supported by SAS Cloud Analytic Services (CAS) for table columns, including fi...

View code
Data Manipulation
INDEX Function with CHAR and VARCHAR Strings

This script illustrates the use of the INDEX function to find the position of a substring in CHAR and VARCHAR type va...

View code
Data Manipulation
Keeping Variables in a CAS DATA Step

Explains the use of the KEEP statement in a DATA step executed in distributed memory (CAS) to select variables to ret...

View code
Data Manipulation
Handling Missing Values with the SUM Function

Demonstration of using the SUM function to add variables containing missing values.

View code
Data Manipulation
Using Interval Multipliers in Date Functions

Demonstration of using the INTNX function with interval multipliers to calculate future dates based on weeks.

View code
Data Manipulation
Value Match Search and Variable Name Retrieval

This script creates a financial ratings dataset and demonstrates different methods to identify which column (rating a...

View code
Data Manipulation
Demonstration of String Length Functions

Example of using SAS functions to determine the length of character strings.

View code
Data Manipulation
Using the CEIL and FLOOR mathematical functions

Script demonstrating the CEIL and FLOOR rounding functions on numerical data.

View code
Data Manipulation
Removing left spaces with the LEFT function

Script illustrating the use of the LEFT function to remove leading spaces from a character string.

View code
Data Manipulation
Using the MEAN function

Simple example showing how to calculate the mean of variables in a DATA step.

View code
Data Manipulation
Using COUNT and COUNTC functions

This SAS script demonstrates the use of COUNTC and COUNT functions to count character and substring occurrences withi...

View code
Data Manipulation
Demonstration of the CHOOSEC function

Simple example of using the CHOOSEC function in a DATA _null_ step.

View code
Data Manipulation
CATX() Function Demonstration

This SAS script demonstrates the use of the CATX() function for variable concatenation, specifically its handling of ...

View code
Data Manipulation
Monetary Data Formatting

Script for creating a cost table and applying a monetary format.

View code
Data Manipulation
Using SAS Numeric Functions

This SAS script demonstrates the use of several built-in numeric functions (CEIL, FLOOR, INT, ROUND) in a DATA step t...

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
Data Manipulation
Using the ZIPCITY function

Script demonstrating the use of the ZIPCITY function to get a city name from a postal code.

View code
Data Manipulation
Date Manipulation with INTNX

Script illustrating the use of the INTNX function to calculate future dates based on regional conditions.

View code
Data Manipulation
Creation and Sorting of the CLASSTEST Table

Creation of a 'classtest' dataset via internal data, followed by sorting by name and subject.

View code
Data Manipulation
Mastering PROC CONTENTS: How to View SAS Table Metadata and Variable Attributes

Displays the structure and metadata of the SASHELP.BASEBALL table.

View code
Data Manipulation
Demonstration of Adding SAS Data Sets

This SAS script demonstrates the use of the PROC APPEND procedure to add observations from one SAS data set to anothe...

View code