In this section: |
A Maintain application can include multiple procedures. Each procedure comprises one FOCEXEC file and, optionally, a WINFORMS file containing the procedure's Winforms. This section gives you a brief overview of how to develop, store, and run Maintain procedures.
FOCUS provides you with several ways to develop a Maintain procedure:
For example, consider a data entry procedure in which the user needs to enter data and write it to the data source. You can create a Winform with entry fields and a command button, then assign a trigger with a function to the button, and finally code the function to update the data source. You perform all of these steps seamlessly within the Winform Painter. The Painter even generates some of the code for you.
Because each Maintain procedure must reside in its own FOCEXEC, you cannot create ad hoc procedures at the FOCUS command prompt. For more information about using the Winform Painter to develop procedures, see Tutorial: Painting a Procedure, and Using the Winform Painter. For more information about using TED, see the Overview and Operating Environments manual.
Each Maintain procedure is stored in two files:
In z/OS
ALLOC F(WIcoNFORMS) DA(WINFORMS.DATA) SHR
and under MSO or z/OS FOCUS:
DYNAM ALLOC FILE WINFORMS DATASET user.WINFORMS.DATA
The PDS's DCB attributes are RECFM=FB, LRECL=80, and BLKSIZE, a multiple of LRECL. When FOCUS searches for a WINFORMS file, it first looks for ddname WINFORMS. If ddname WINFORMS is not allocated, FOCUS attempts to allocate the data set prefix.WINFORMS.data to ddname WINFORMS. If the specified member is not there, FOCUS displays an error message.
Each procedure has one FOCEXEC file and—if it has a user interface—one WINFORMS file. The two files share the same member name. For example, the Payroll procedure is stored in the member PAYROLL of the FOCEXEC PDS and member PAYROLL in the WINFORMSPDS.
FOCUS provides you with the flexibility of executing a Maintain procedure from different kinds of environments, and employing different control techniques.
In addition, you can accelerate execution by compiling a procedure using the COMPILE command. You may wish to work with the procedure in its regular form while you are developing it, and then—once it is finished—compile it to make it faster.
You can run a procedure from the following environments:
Alternatively, you can run an uncompiled Maintain procedure by naming it in a Menu window (using the Window Painter's FOCEXEC Name option) in the calling procedure's FMU or TRF file.
The EXEC command, Execution and Menu windows, and the Window Painter are all described in the Developing Applications manual. The CALL, COMPILE, and RUN commands are described in Command Reference.
Information Builders |