Posts

Advanced SDTM Programming Tips: Automating SUPPQUAL Domain Creation

Advanced SDTM Programming Tip: Automating SUPPQUAL Domain Creation Advanced SDTM Programming Tip: Automating SUPPQUAL Domain Creation Optimize Your SDTM Workflows with Efficient Automation Techniques Introduction to SUPPQUAL Automation The SUPPQUAL (Supplemental Qualifiers) domain is used to store additional information that cannot fit within a standard SDTM domain. Manually creating the SUPPQUAL domain can be time-consuming and error-prone, especially for large datasets. In this article, we’ll explore an advanced tip to automate its creation using SAS macros. Use Case: Adding Supplemental Qualifiers to a Domain Imagine you have an SDTM AE domain (Adverse Events) and need to capture additional details like the investigator’s comments or assessment methods that are not part of the stan...

Hash Objects

Advanced SAS Programming Tip: Using HASH Objects Advanced SAS Programming Tip: Using HASH Objects Unlock the Power of SAS for Efficient Data Manipulation Introduction to HASH Objects In SAS, HASH objects provide an efficient way to perform in-memory data lookups and merge operations, especially when dealing with large datasets. Unlike traditional joins using PROC SQL or the MERGE statement, HASH objects can significantly reduce computational overhead. Use Case: Matching and Merging Large Datasets Suppose you have two datasets: a master dataset containing millions of records and a lookup dataset with unique key-value pairs. The goal is to merge these datasets without compromising performance. Code Example: Using HASH...

Advanced SAS Programming Tip: Mastering Macro Variables

Advanced SAS Programming Tip: Mastering Macro Variables Advanced SAS Programming Tip: Mastering Macro Variables Unleash the power of SAS with this advanced technique. Introduction Macro variables are a powerful tool in SAS that allow you to dynamically generate code. By understanding and effectively using macro variables, you can write more efficient and flexible SAS programs. The Basics of Macro Variables A macro variable is a placeholder that is replaced with its value during macro processing. You define a macro variable using the %LET statement and reference it using the %SYSFUNC or %SYSEVALF functions. Advanced Techniques 1. Conditional Logic You can use the %IF-%THEN-%ELSE statements to create conditional logic within your macro code. This allows you to dynamically generate code based on specific conditions. 2...

CMENRTPT vs CMENRF in SDTM

CMENRTPT vs CMENRF in SDTM Understanding CMENRTPT vs CMENRF in SDTM By Sarath Introduction When working with the Concomitant Medication (CM) domain in SDTM, it's crucial to understand how timing variables like CMENRTPT (End Relative to Reference Time Point) and CMENRF (End Relative to Reference Period) differ and when to use each. What is CMENRTPT? CMENRTPT indicates the relationship between the end of the medication and a specific time point , such as the start of treatment or a significant event (e.g., surgery). Controlled Terminology: BEFORE, AFTER, ONGOING, CONCURRENT Example: If a medication was stopped before surgery, CMENRTPT = "BEFORE" . What is CMENRF? CMENRF describes whether the medication ended ...

Resolving the SAS EG Transcoding Error

Resolving the SAS EG Transcoding Error Addressing the "Character Data Lost During Transcoding" Issue in SAS EG Author: Sarath Date: November 19, 2024 Introduction While working in SAS Enterprise Guide (SAS EG), you may encounter the error: "Some character data was lost during transcoding in the dataset." This issue typically arises when character data contains unsupported characters or is truncated due to insufficient column lengths. In this blog post, we'll explore the root causes and provide step-by-step solutions. Common Causes Unsupported Characters: The data contains special or non-ASCII characters not representable in the session encoding. Truncation: Character variables are too short to store the full data, leading to loss of information. ...

Advanced SAS programming Techniques for SDTM implementation

Advanced SAS Programming Techniques for SDTM Implementation Date: November 3, 2024 In the realm of clinical trials data management, SDTM (Study Data Tabulation Model) implementation requires sophisticated programming techniques to ensure data accuracy and compliance. This article explores advanced SAS programming methods that can streamline SDTM dataset creation and validation. 1. Efficient Variable Derivation Using Hash Objects Hash objects in SAS provide a powerful way to perform quick lookups and merges, especially useful when dealing with large SDTM datasets. data work.ae; if _n_ = 1 then do; declare hash h_dm(dataset: "sdtm.dm"); h_dm.definekey("usubjid"); h_dm.definedata("age", "sex", "race"); h_dm.definedone(); end; set raw.ae; rc = h_dm.find(); /* Continue processing */ run; Pro Tip:  Hash objects remain in memory throughout the DATA step, making them more efficient than tr...

Harnessing the Power of CALL EXECUTE in SAS for Dynamic Code Execution

Harnessing the Power of CALL EXECUTE in SAS for Dynamic Code Execution Harnessing the Power of CALL EXECUTE in SAS for Dynamic Code Execution As SAS programmers, we often encounter situations where we need to execute a certain procedure or set of steps multiple times, typically based on different subsets of data. Manually writing out code for each instance can be time-consuming, but SAS offers a powerful tool to make this process more efficient: CALL EXECUTE . What is CALL EXECUTE? CALL EXECUTE is a SAS routine that allows you to dynamically generate and execute SAS code during a data step’s execution. Instead of hardcoding the logic for every individual case, CALL EXECUTE can generate the code on the fly and execute it as part of the same data step. This technique is invaluable when you have repetitive tasks across different datasets, procedures, or even report generation. Basic Example: Dynamic PROC PRINT Execution Let...