SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Automating Registration External Files in SAS DI Studio

New Contributor
Posts: 4

Automating Registration External Files in SAS DI Studio

Hi All,


I have a few hundred csv files which I need to register in DI Studio (so that they either appear under External Files in the inventory or are imported straight into a SAS library) I also need to set formats and lengths etc. I'd rather not do all of this manually through te wizard but cannot find a way of registering external files fully in code. The register external files wizard doesn't produce any code, just the INFILE statement.


I have a table which contains all, table names, field names, field types and lengths within all of the csv files and was hoping to be able to use macro code to loop over this and create everything on the fly.


Does anyone please have any ideas on how could this be implemented in DI Studio?




Super User
Posts: 5,852

Re: Automating Registration External Files in SAS DI Studio

I don't think that there's a solution out of the box.
You could use a document template as input to the External File wizard, which will minimise the manual input. But you still need to call the wizard for all files...

To loop through all you need to program something that utilises data step meta data functions, or proc metalib.

A third option would be if you could have your definitions stored in a tool supported by SAS Metadata Bridges. Haven't tested it for external files though...
Data never sleeps
Respected Advisor
Posts: 4,679

Re: Automating Registration External Files in SAS DI Studio

A few hundred csv files sounds like you would want to explore some ways of automation but before going down this path:

Do all these csv's have different structures or are these just a few structures? If these are only a few structures then there are ways to create "metadata templates" instead.


I guess it's not only about the csv's but you also need the DIS jobs extracting the data and load it to somewhere. If you can give us a bit more detail what you have and how your process looks like then we can eventually show you alternative ways of how you could design and implement.


Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 3 in conversation