|
Download the XLSREAD Applet (8/25/2000, 520K) The SCA Applet, XLSREAD, is used to read numeric data from an Excel spreadsheet and write the data into a plain ASCII file or an SCA data macro. The data can then be read into the SCA workspace using the INPUT or CALL commands. SCA Development Partners may also leverage this applet to read data from an Excel spreadsheet and export it into a simpler format which can be used by other applets and user-developed programs. The XLSREAD applet, as well as other programs, can be executed coveniently by imbedding instructions directly within an SCA macro procedure. Arguments are passed to the XLSREAD applet by submitting a control file or by setting command line options. The applet is then executed from within an SCA macro procedure using the RUN or RUNW commands. Below is an example of how to contruct a control file as imbedded commands within an SCA macro procedure. The BUILD command specifies the name of the control file to create. The statements between the BUILD and ENDBUILD commands are the actual instructions to be written to the control file. The ENDBUILD command closes the opened file and allows the user to continue processing other commands in the SCA System. In this example, a control file named "xlsread.ctl" is created. The commands written to this file instruct the applet to read three variables (X, Y, and Z) from a worksheet named "sheet1" in an Excel file named "myfile.xls". The data extracted from the Excel spreadsheet is then written to an output file named "test.dat" in ASCII format.
BUILD 'xlsread.ctl' Once the necessary instructions for the applet are generated in the "xlsread.ctl" file and the file is closed using the ENDBUILD command, the applet may be executed by issuing the following RUN command in the SCA System: RUN XLSREAD 'xlsread.ctl' After the "RUN XLSREAD ..." command is executed, the data may be read into the SCA System workspace by issuing the following INPUT command: INPUT X, Y, Z. FILE 'test.dat'. The XLSREAD applet provides an alternative command syntax based on parameter tags. This alternative command syntax is useful when many of the default parameter settings of an applet can be used. An example of this shorthand command style is presented below. It accomplishes the same result as the control file example above: RUN XLSREAD /V:X,Y,Z /F:'myfile.xls' /O:'test.dat' If a program does not have an "SCA-like" control language, you can still leverage SCA Applet technology to execute these programs under the SCA System. However, these programs must be capable of executing in batch mode. The instructions for building commands for alternative style programs follow the example presented here.
Legend: v -- variable name; i -- integer value; 'c'-- character string; w -- keyword Sentence Descriptions
VARIABLES sentence (/V) FILE sentence (/F) SHEET sentence (/S) OUTFILE sentence (/O) FORMAT sentence (/FMT) SPAN sentence (/SPA) TYPE sentence (/T) LABELS sentence (/L:ON) |