Introductory example
The standard Mosel syntax for reading and writing data uses initializations blocks to access external files, such as
declarations A: array(set of integer) of real ! Array of unknown size (=dynamic) B: array(1..7) of string ! Array of known size (=static) end-declarations initializations from "mydata.dat" A B as "MyB" end-initializations
where the datafile mydata.dat may have the following contents:
A: [(3) 2 (1) 4.2 (6) 9 (10) 7.5 (-1) 3] MyB: ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"]
To obtain access to file types other than text files in Mosel format we merely need to modify the filename string, prefixing the name of the data source by the I/O driver we want to use followed by a colon. For instance, to read a text file in comma separated format we may use the driver prefix "mmetc.diskdata:". I/O drivers may be seen as filters that decode data from some other format, transforming it into the format used by Mosel—or the other way round. For further detail on the concept of I/O drivers, the reader is referred to the Xpress Whitepaper Generalized file handling in Mosel.
© 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.