As statistical analysts supporting global medical device regulatory submissions, we routinely deal with requests to generate SAS Table, Figure, and Listing (TFL) in English and the local language, e.g. Chinese or Japanese. We also need to prepare batch files to execute SAS codes to increase programming efficiency. File folder cloning and SAS source code searching and replacement in bulk are also necessary steps for many reporting activities. Text processing is common to many of daily tasks like what are mentioned above.
As a modern general purpose and high-level programming language, python is very powerful, especially in manipulating text data. In this paper, we present a few python applications to improve efficiency and accuracy in SAS programming work: (1) Generic Unicode conversion and handling in SAS programs to support non-English languages; (2) SAS dataset program and SAS TFL program execution batch file generation; (3) Structured folder generation.
SAS macros can be created to generate input parameters and configuration files for Python programs. This enables SAS programmers, without knowing Python languages, to finish tasks by simply calling SAS macros. With its simple syntax rules and readability, Python has more potential applications that could make SAS programmers’ lives easier.