The mcr_sas2db Module
This loader is used to ingest files generated by SAS software in SAS 7BDAT format. It looks for SAS 7BDAT files in a given path matching a given pattern and loads the data into the database.
Before running the loader, one should generate database schema by introspecting the metadata defined in the SAS 7BDAT files.
It is used to ingest Medicare data for 1999 to 2010 years.
See also:
- SASIntrospector
for introspection and schema analysis of SAS files.
- class SASLoader[source]
Loader class that looks for SAS 7BDAT files in a given path matching a given pattern and loads the data in the database.
This loader is used to ingest Medicare data for 1999 - 2010 years
Initialize the MedicareSAS base class.
- Args:
- root_dir (str or List[str]): Root directory (or directories) containing SAS files.
This can be a single directory as a string or a list of directories.
- handle(table: str, file_path: str, file_type: str, year: int)[source]
Handle a single SAS 7BDAT file by creating a data loader instance and invoking the loading process.
This method overrides the abstract method from the parent class
MedicareSAS
.For each input file, it creates an instance of
DataLoader
configured with the appropriate context, and then runs it to ingest data.- Args:
table (str): Target table name for the data. file_path (str): Absolute path to the source SAS file. file_type (str): Type or category of the SAS file. year (int): Year associated with the data file.