Initializing help system before first use

# exportprob

Purpose
Export the current LP/MIP problem held in Mosel core (the portion of a problem defined with mpvar and linctr only) to a file.
Synopsis
`procedure exportprob(options:integer, filename:string, obj:linctr)`
`procedure exportprob(options:integer, filename:string)`
`procedure exportprob(filename:string, obj:linctr)`
`procedure exportprob(filename:string)`
`procedure exportprob`
Arguments

options | File format options:
EP_MIN | minimization (default)
EP_MAX | maximization
EP_MPS | MPS format
EP_STRIP | Use scrambled names
EP_HEX | Ouput numbers in hexadecimal when using MPS format
Several options may be combined using +.
filename | Name of the output file. If the empty string "" is given, output is printed to the standard output (the screen)
obj | Objective function constraint

Example
The following prints the current problem to the screen using the default format and with MinCost as objective function. The second statement exports the problem in LP-format and with scrambled names to the file prob1.lp maximizing the constraint Profit:

    declarations
     MinCost, Profit:linctr
    end-declarations

    exportprob(0, "", MinCost)
    exportprob(EP_MAX+EP_STRIP, "prob1", Profit)

Further information
1. Problem types: This function exports only the LP/MIP problem directly handled by the Mosel core libraries. It cannot report problem extensions managed by external modules—these are silently ignored. For instance, quadratic constraints, indicator constraints or general constraints provided by the Xpress Optimizer are not shown by this routine: for this type of problems, the module-specific writeprob routine has to be used instead of exportprob.
2. Number format: Except when option EP_MPS+EP_HEX is used numbers are ouput according to the realfmt, txtztol and zerotol model parameters (see setparam). Mosel's real number formatting follows C printing format which is different, for example, from the formatting rules applied by Xpress Optimizer, in particular in the module-specific writeprob routine.
3. File extension: If the given filename uses the default IO driver (no driver specified) and has no extension, Mosel appends .lp to it for LP format files and .mps for MPS format.
4. Entity names: Normally, local symbols ( i.e. defined in a procedure or function) are replaced by generated names in the exported matrix. However, if the model has been compiled with option -G, names defined locally to the routine calling exportprob are used in the exported matrix. Moreover, if a local symbol hides a global one, this symbol is prefixed by '∼'.
5. If the model is compiled with -G and the control parameter recloc is set to true (see setparam), missing constraint names are replaced by the source location of the constraint definition ( i.e. a combination of the row number, source file name and line number in the file).
6. If no option is provided, the default format is LP for a minimization; if no constraint is given, the current objective (if available) is exported. The matrix is printed to the standard output when this function is used without parameter.
Related topics
setname.
Parent Topic Predefined functions and procedures

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.