Manipulating Text Fields in SAS: Compress, Tranwrd and Scan

From sasCommunity
Jump to: navigation, search

by Sata Hackenbruck

This paper discusses how to use the COMPRESS, TRANWRD, and SCAN functions to manipulate text fields.

Often in medical research, prescription drugs may have many variations in their name. For example, a data-set may show "Fentanyl Citrate" as "Fentanyl Citrate Buccal Tab 100 MCG (Base Equiv)," "Fentanyl Citrate Inj 0.05 MG/ML," "Fentanyl Citrate Lollipop 1600 MCG," etc. This paper shows how to use Compress, Tranwrd, and Scan to condense these variations to their common name, to allow for easy categorization.



Presented at a State of Oregon SAS Users Group meeting.
Find more SOSUG presentations, as well as other tips, tricks, and tools created by or recommended by SOSUG members here.