SAS Tips and Tricks

Read all files of a directory

SAS macro language allows you to process dynamically all the files of a directory or all the files of a library . Different technic exist depending on the nature of the files. This tips and tricks discuss the case when your files are datasets present in a single library and discuss the case when we manipulate flat files in a folder structure.

Details

You have created a code which allows you to do a data manipulation on a specific dataset and would like to apply this on all the datasets of a library or have created a SAS code which import a flat file and would like to import all the flat files of a directory (with the hypothesis that all the flat files have same layout). You could always embed the code in a macro and then call it for every dataset or flat file but what would happen if you would like to do it dynamically by scanning all the files automatically?
In this tips and tricks we will discuss 2 methods to read files in a folder: the pipe and the %do loop and then see how we could use dictionary tables to read all the datasets of a library.

Prerequisites

You have some SAS experience and know how to program a Data Step. You have to execute the same code for a list of files.

Quick Facts

  • Scheduled date: Course not yet scheduled
  • Duration :3 Hours
  • Fee :240 Euros (VAT Exclusive)
  • Language: French/English
  • Included: Coffees, tips and tricks material

Christophe Kabacinski

click here to get more information about this teacher.

Course Location

This course will be organized at : Lodge.co Boulevard Simon Bolivar 34 1000 Bruxelles


Go back to your selection