Category: SAS


SAS day 56: ANYALPHA  Background Story: Once we had an excel sheet with an extreme variety of date formats that don’t make sense. Is there a method to clean the data so they will be meaningful dates? Raw Data: Solutions Ideas: After observing the data structure, we notice it either starts with a letter or number. Therefore, we will apply…

Proc Export +Proc Report to Fancy Excel Output

SAS day 55 Background Story: Once we need to generate an Adverse Event listing for the medical team to review in excel, I was amazed by my colleague’s colorful output from SAS. I was just simply happy to look at the output! Example: I will use to generate the output   SAS Code:   *—————————–*; * To generate excel…

SAS Proc Format

SAS day 54 We know Format is a common function to convert date in SAS, such as, format aestdt date9. . What about Proc Format? When and how should we use it?   Case 1: Numeric to Character Presentation When data are coded in numerical, we would like to display it in characters in Frequency tables.   Syntax: Proc Format;…

Confidence Interval for Adverse Event

sas day 53: A classical AE table is by  SOC (body system class) and  Preferred term( AEDECOD). The overall AE table could last for over 100 pages long. What if we’d like to see the count and confidence Interval for some Special Interested Adverse Event (SIAE) within the whole safety population. Challenge: How to generate an AE table with confidence…

SAS rename

SAS Day 52 Once I use SAS proc import  a Special Adverse Event dataset, everything looks good, except the variable name was directly from excel and has space and special characters like “/” (EOI/ Search)  Little Challenge: How to Rename a variable with space or special characters? Basic Rename Syntax: *1. within dataset data a; set a; rename old_name=new_name; run;…


ADaM day 7 ADDV protocol deviation dataset identifies occurrences of sponsor-defined deviations, which is a list specified for every study.  For example, the description of deviation can be Positive Drug Screen, PK labs not drawn in the proper window. A Sample ADDV Dataset key variables:subjid, dvstdt, dvcatcd, dvdeter, dvdesc , dvdact, dvact1, dvtype, dvstype. Key variable indications: dvcatcd=”DV Category Code”…

Proc Contents

SAS day 51:  Proc Contents Background story: One day, we need to search for a particular variable from 90 datasets. It would be a mission possible without Yajnes’s trick of Proc Contents.

SAS Xpt file Import

SAS day 50: Background: Sometimes, we need to transfer some .xpt file to .sas7bat datasets for an old study.  While other times we need to convert .sas7bat data to .xpt format for FDA define submission. So Today we will go over the procedure to Convert the .xpt and .sas7bat files. Blood Key : access=READONLY

SAS Where Like

SAS day 49: Background story: Where doing safety analysis, sometimes we need to look into the drug relations with Special Interest Adverse Events, which are similar, such as “Glaucoma”  and “Glaucosis”. While investigating into these special interest events, instead of using AESI in (“x”, “y”,”z” ) we prefer a more robust way.

No Observation

SAS Day 48: Challenge: How to create a label for “No Observation” when there is no observation? Approach: We know SQL is the best tool for Counting and macro for generating all 0 counts 

Social media & sharing icons powered by UltimatelySocial