0 / 0
Model input and output data file formats for Decision Optimization
Last updated: Dec 05, 2024
Decision Optimization model input and output data file formats

With your Decision Optimization model, you can use the following input and output data identifiers and extension combinations.

This table shows the supported file type combinations for Decision Optimization for deployment:
Model type Input file type Output file type Comments
cplex
.lp
.mps
.sav
.feasibility
.prm
.jar for Java™
models
.xml
.json

The name of the output file must be solution

The output format can be specified by using the API.

Files of type .lp, .mps, and .sav can be compressed by using gzip or bzip2, and uploaded as, for example, .lp.gz or .sav.bz2.

The schemas for the CPLEX formats for solutions, conflicts, and feasibility files are available for you to download in the cplex_xsds.zip archive from the Decision Optimization github.

cpo .cpo
.jar for Java
models
.xml
.json

The name of the output file must be solution

The output format can be specified by using a run parameter.

For the native file format for CPO models, see: CP Optimizer file format syntax.

opl
.mod
.dat
.oplproject
.xlsx (deprecated)
.json
.csv
.jar for Java
models
.xml
.json
.txt
.csv
.xlsx (deprecated)
The output format is consistent with the input type, but can be specified by using a run parameter if needed.

To connect to Microsoft Excel files, use a data-connector. The data-connector transforms your Excel file into a .csv file.

Only models that are defined with tuple sets can be deployed; other OPL structures are not supported.

To read and write input and output in OPL, see OPL models.

docplex
.py
*.* (input data)
Any output file type that is specified in the model. Any format can be used in your Python code, but to take advantage of data connectors, use the .csv format.

To read and write input and output in Python, use the commands get_input_stream("filename") and get_output_stream("filename"). See DOcplex API sum example

Data identifier restrictions
A file name has the following restrictions:
  • Is limited to 255 characters
  • Can include only ASCII characters
  • Cannot include the characters /\?%*:|"<>, the space character, or the null character
  • Cannot include _ as the first character
Referenced data
When using data assets or connection assets for tabular data, use .csv as the data-identifier extension in the id field, regardless of the asset type. The data-connector makes the necessary transformations, so that you can load or save data without needing to change the format of the data. You can thus use the same Decision Optimization model with many different data-source types and formats by using a data-connector to reference both the source and target data. If you use other data-identifier extensions, the data is loaded or saved as a raw-data binary-file without any transformation. For more information, see Input data sources for Decision Optimization deployment jobs and Output data for Decision Optimization deployment jobs.
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more