How to Review SDTM Data Faster — A Clinical Programmer's Guide
If you've spent time reviewing SDTM data for a regulatory submission, you know the routine: open SAS Enterprise Guide or a PROC PRINT, write a quick WHERE clause, run it, tweak it, run it again. By the time you've checked AE, CM, MH, LB, and VS for a single subject, you've written more code than the review itself requires.
StatDataViewer was built to eliminate that code-writing overhead. This guide walks through the three features that speed up SDTM review the most: the library filter, the SDTM supplemental domain join, and USUBJID frequency counting.
The problem with one-file-at-a-time viewers
Most dataset viewers — including the SAS built-in viewer — open one file at a time. To compare subject data across AE, CM, and LB, you either open three windows and switch between them, or write code to merge the domains. Neither is fast.
StatDataViewer's model is different. You open an entire library — a folder of datasets — and apply a single WHERE clause across all of them simultaneously. That clause travels with you as you switch tabs.
Step 1 — Set up the library
Open StatDataViewer and choose File → Add Library. Point it at your SDTM folder. Every .sas7bdat and .xpt file in the folder appears in the Workspace panel instantly. No configuration, no catalog required.
Give the library a meaningful name: right-click it and choose Set Library Name. Type SDTM — the name appears as a prefix in the workspace and in tab titles, so you always know which domain you're looking at.
Step 2 — Apply a library filter to follow one subject
Open the DM dataset and find your subject of interest. Right-click the USUBJID value — say ABC-001-0042 — and choose WHERE: USUBJID = "ABC-001-0042".
That single action applies the WHERE clause to every dataset in the library. Now open AE — you see only the adverse events for subject 42. Open LB — only their lab values. Open VS — only their vitals. You are following one subject through the entire SDTM submission without writing a line of code or adjusting a single filter.
The active library filter is always visible in the status bar at the bottom of the screen. Press Alt+C to clear it when you're done.
The library filter is the single most time-saving feature in StatDataViewer for SDTM review. What used to require a PROC SQL merge or repeated WHERE clauses in SAS is now one right-click.
Step 3 — Join a SUPP__ domain without code
SDTM supplemental qualifier datasets (SUPPAE, SUPPEX, etc.) store non-standard variables in a transposed structure: QNAM, QLABEL, QVAL. Reading them in their raw form is tedious — you need to pivot IDVAR/IDVARVAL back into columns to make sense of the data.
In StatDataViewer, open AE and right-click the tab (or any cell). Choose Join with Supplemental. StatDataViewer:
- Finds
SUPPAEin the same library automatically. - Pivots the QNAM/QVAL pairs using IDVAR/IDVARVAL to match rows.
- Adds the supplemental variables as new columns to the right of the standard AE columns.
The result is a denormalized view — every QNAM value becomes a column. No PROC TRANSPOSE, no PROC SQL, no code at all.
Step 4 — Check incidence with USUBJID frequency
During safety review you often need to know: "How many subjects experienced each preferred term?" PROC FREQ with a BY statement gives you this — but again, that means writing code.
In StatDataViewer, open AE, click any cell in the AEDECOD column, and press N. The USUBJID frequency window opens, showing:
- Each preferred term value
- The count of distinct USUBJIDs who have that term
- The percentage of subjects in the filtered (or unfiltered) dataset
If you want incidence by body system and preferred term simultaneously, hold Ctrl, click one cell in AEBODSYS and one in AEDECOD, then press N. You get a two-dimensional USUBJID crosstab — the kind that used to require a full PROC FREQ call with TABLES aebodsys*aedecod.
Putting it together: a 5-minute SDTM review
Here is the full workflow for reviewing a safety signal for a single subject:
- Add the SDTM library and name it
SDTM. - Open
DM. Find the subject. Press L on their USUBJID to set the library filter. - Open
AE. Join with SUPPAE (Right-click → Join with Supplemental). Review all AE rows and supplemental columns for this subject. - Open
CM,MH,LB— all already filtered to the subject. - Press Alt+C to clear the library filter. Press N in the AEDECOD column to review overall incidence.
Where to go next
The features described here are covered in detail in the SDTM tools, Filtering, and Frequencies & crosstabs sections of the documentation. The browser version lets you try them immediately with sample data — no download required.