You can create FOCUS executable procedures (FOCEXECs) using TED, just as you can create any other file. One advantage of creating or editing FOCEXECs in TED is that you can use the RUN command, which enables you to run a FOCEXEC from within TED without moving to an editor outside the FOCUS command level. For example:
M1-1 FOCEXEC A1 SIZE=10 LINE=0 * * * TOP OF FILE * * * MODIFY FILE EMPLOYEE FREEFORM EMP_ID CURR_SAL MATCH EMP_ID ON NOMATCH REJECT ON MATCH UPDATE CURR_SAL DATA EMP_ID=071382660, CURR_SAL=21400.50, $ EMP_ID=112847612, CURR_SAL=20350.00, $ EMP_ID=117593129, CURR_SAL=22600.34, $ END * * * END OF FILE * * * ====> RUN EDITING MODE |
Once you type RUN and press the Enter key, this FOCEXEC is executed by FOCUS. Also note that you can add parameters to the RUN command. For example:
====> RUN ECHO=ON
If there is an error in the FOCEXEC, simply enter
TED
after the error message. The file will be redisplayed in TED, with the error line as the current line.
Note: In CMS you cannot issue the RUN command from TED unless the file type of your file is FOCEXEC. This is not required in z/OS.
In the following example, the FOCEXEC is missing the file name:
M1-1 FOCEXEC A1 SIZE=10 LINE=0 * * * TOP OF FILE * * * MODIFY FILE FREEFORM EMP_ID CURR_SAL MATCH EMP_ID ON NOMATCH REJECT ON MATCH UPDATE CURR_SAL DATA EMP_ID=071382660, CURR_SAL=21400.50, $ EMP_ID=112847612, CURR_SAL=20350.00, $ EMP_ID=117593129, CURR_SAL=22600.34, $ END * * * END OF FILE * * * ====> RUN EDITING MODE |
After you type RUN and press the Enter key, FOCUS displays the following error:
ERROR AT OR NEAR LINE 2 IN PROCEDURE M1-1 FOCEXEC * (FOC205) DESCRIPTION NOT FOUND FOR FILE NAMED: FREEFORM BYPASSING TO END OF COMMAND > |
If you enter the TED command (it is not necessary to include the file name), you are placed in EDIT mode with the following screen displayed. The current line is FREEFORM EMP_ID CURR_SAL.
M1-1 FOCEXEC A1 SIZE=10 LINE=2 FREEFORM EMP_ID CURR_SAL MATCH EMP_ID ON NOMATCH REJECT ON MATCH UPDATE CURR_SAL DATA EMP_ID=071382660, CURR_SAL=21400.50, $ EMP_ID=112847612, CURR_SAL=20350.00, $ EMP_ID=117593129, CURR_SAL=22600.34, $ END * * * END OF FILE * * * EDITING MODE |
Note: FOCEXECs are described in detail in the Developing Applications manual.
Information Builders |