Initializing help system before first use

# Using the Mosel Command Line

The Mosel Command Line is supported on all platforms that Mosel can be run on.

Standard sequence for model execution from the command line:

    mosel exec mymodel.mos            Execute (=compile/load/run) model 'mymodel.mos'
    mosel mymodel                     Short form (works with 'mymodel.mos' or 'mymodel.bim')

Some useful commands (see `Mosel Language Reference manual' for the full list):

Command line help text:

      mosel -h

Mosel version:

      mosel -V

Display functionality:

      mosel exam[ine] [-cspthirvaum]

Execute a model file:

      mosel exec[ute]

Compile a model file:

      mosel comp[ile] mymodel.mos

Load and run a BIM file:

      mosel run mymodel.bim

Start the debugger:

      mosel debug mymodel.mos

Run the profiler:

      mosel prof[ile] mymodel.mos

Perfom a code coverage run:

      mosel cover[age] mymodel.mos

List available modules/packages:

      mosel lslib

Examples:

    mosel comp mymodel.mos -o mybim.bim   Compile to a specified BIM file name/location
    mosel prof mymodel.mos            Perform a profiler run (output in 'mymodel.mos.prof')
    mosel exam -h                     Display Mosel version info and paths
    mosel exam -a mybim.bim           Display annotations of a model or package
    mosel exam -ps mmxprs             Display parameters and subroutines of module 'mmxprs'

Setting model runtime parameters:

    mosel exec mymodel NT=5 DATAFILE="mynewdata.dat"    Source in mymodel.mos
    mosel run mymodel NT=5 DATAFILE="mynewdata.dat"     Loads mymodel.bim
    mosel mymodel NT=5 DATAFILE="mynewdata.dat"         With mymodel.mos or mymodel.bim

## Debugger commands

Breakpoints:

      break  delete  bcond[ition] breakpoints breaksub

Model execution:

      cont  next  step  finish  model

Output:

      display undisplay list print info exportprob
      lsattr lslibs lslocal lsmods lssymb

Stack access:

      up  down  where

Interpreter options:

      option

Termination:

      quit

Example: Simple debugging sequence

    mosel debug debugexpl.mos         Start Mosel debugger
    break 20                          Set breakpoint at line 20
    cont                              Execute up to the breakpoint
    print D                           Print out symbol 'D'
    cont                              Continue model execution
    info Arr                          Information about model object 'Arr' (e.g. size)
    lsmods                            Display model info (e.g. memory usage)
    quit                              Quit the debugger

Example: Debugging a submodel

    mosel debug debugmain.mos         Start Mosel debugger on main model
    breaksub 1                        Stop at start of submodels
    cont                              Execute up to the breakpoint
    break 25 debugsub.mos             Set breakpoint in the submodel
    display SNumbers                  Display watch on object 'SNumbers'
    cont                              Execute up to the breakpoint
    break 31 debugsub.mos             Another submodel breakpoint
    bcond 2-2 SNumbers.size < 10      Condition on 2nd submodel breakpoint
    cont                              Execute up to the breakpoint 2-2
    quit                              Quit the debugger

Parent Topic Mosel Language Quick Reference

© 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.