Chapter 3: The Operating System


Checking the Operating System

Running Operating System Commands

Using the X Statement

Using the SYSTEM() Function

Using a FILENAME Pipe

Working with the File System

Creating and Deleting Directories

Working with Files

Reading and Writing External Files

Using the $VARYING. Format and Informat

Using the FILEVAR= Option

Reading Date and Time Values

Creating a CSV File from a Data Table

Reading a CSV File with Embedded Line Feeds


In a SAS program, you sometimes need to access the operating system (OS) to run system commands and to access the file system. Reading data from external files is usually a requirement in a SAS application; you have to get the data into tables before you can analyze ...

Get Practical and Efficient SAS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.