Creating CSV Files with ODS MARKUP

A CSV file contains columns of data values that are separated by commas. It is a common way to transfer data in and out of Microsoft Excel and other software programs.

Three SAS tagset templates can create CSV files:

  1. ODS CSV creates a CSV output file that contains only the column headers and data values.

  2. ODS CSVALL creates a CSV output file that contains the column headers, data values, titles, BY lines, and notes.

  3. ODS TAGSETS.CSVBYLINE creates a CSV output file that contains the column headers, data values, and BY lines.

The following code invokes the three tagset templates. As you might imagine from their names, there are differences in the data contained in each of the three outputs.

ODS CSV FILE='result1.csv'; ...

Get Output Delivery System: The Basics and Beyond 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.