Example
The following example shows how to compile, load, and then run a model from another model. After having started the execution, it waits for 60 seconds before stopping the secondary model if the latter has not yet finished.
model "mmjobs example" uses "mmjobs","mmsystem" declarations mymod: Model event: Event end-declarations ! Compile 'mymod.mos' to memory if compile("","mymod.mos","shmem:bim")<>0 then exit(1) end-if load(mymod,"shmem:bim") ! Load bim file from memory... fdelete("shmem:bim") ! ... and release the memory block ! Disable model output setdefstream(mymod,"","null:","null:") run(mymod) ! Start execution and wait(60) ! wait 1 min for an event if waitexpired then ! No event has been sent... writeln("Model too long: stopping it!") stop(mymod) ! ... stop the model then wait wait end-if ! An event is available: model finished event:=getnextevent writeln("Exit status: ", getvalue(event)) writeln("Exit code : ", getexitcode(mymod)) unload(mymod) end-model
© 2001-2020 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.