Loading transformed data
As described in Chapter 4, Managing ETL in SAS, in a SAS data warehouse, it's not uncommon to receive monthly or annual files that require regular ETL. Imagine receiving the BRFSS files from 2016, 2017, and 2018, and needing to process them. If the datasets are all named according to a particular naming convention, we can use macro code to automatically load the data files and put them through an ETL protocol.
The easiest way to demonstrate this with a simple exercise is to have us generate the multiple files we will later read in. That way, we can concentrate on writing the load macro, and not whether the data will cooperate. For this exercise, we will use the dataset Chap8_2
. This dataset has only two variables: _STATE
and FMONTH
. As with the previous file, the only states included in _STATE
are codes 12
, 25
, and 27
, for Florida, Massachusetts, and Minnesota, respectively. FMONTH
contains the month the survey was conducted coded as a number, 1
through...