Each piece of functionality in an AIMMS application can have several associated datasets — for example, an input dataset and an output dataset. Larger applications therefore end up with many datasets, and it can be useful for an end-user to work with a single data instance that spans several of them.
Because AimmsDEX keeps its annotations separate from the actual generation of mapping files, the collection of datasets can be managed flexibly — for instance, by combining several existing datasets into a new one.
The attached AIMMS project illustrates this: it creates a new dataset from two existing datasets, then uses that combined dataset to write a single Excel workbook.
Running the example
Open MergeDS.aimms. Besides the main model, it references the AimmsDEX library itself, plus three project libraries: ComboDataset, which implements the merge and cleanup logic, and liba/libb, two small example libraries that each define an input dataset (la_inps and lb_inps).
The example itself lives in the procedure pr_WriteSelectedInputDatasetsToExcel in Main_MergeDS — run that procedure directly. It selects the two input datasets, calls cd::pr_mergeDatasets to combine them into a new dataset, writes that dataset to a single Excel workbook via dex::WriteToFile, and then calls cd::pr_cleanupMappingsDataset to remove the mapping files generated along the way.