HP 3000 Manuals

Invoking COBOL System Components [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation


Micro Focus COBOL System Reference, Volume 1

Invoking COBOL System Components 


NOTE The information in this section is relevant only for users of this COBOL system on DOS, Windows and OS/2. It is provided in this manual for those UNIX users who are developing COBOL applications to be portable to one or more of these other environments.
There are a number of ways of invokingmost of the components in this COBOL system. In this book, only the usual way of invoking the components is described. This section provides an overview of the different methods available and explains why you might want to use them. Invoking from a DOS Command Prompt From a DOS command prompt you have two choices for running the component: * under XM to make use of any extended memory your machine has * without XM, using only your machine's base memory. If you have at least 1Mb of extended memory, then you will find using XM is the better option in most cases. To run with XM, precede the command line with XM as follows: xm (xm-switches) command-line For information about using XM, a list of the switches you may need and a description of their effect, see the chapter XM in this COBOL System Reference . To run without XM, just enter at the DOS prompt the command line described in each chapter. Invoking from Windows There are a number of ways you run components under Windows: * Run from a DOS command prompt * Run from the Run... option in the File menu in Program Manager * Use an icon set up during installation * Create your own program item Most of the components come in two versions, DOS applications (sometimes called non-Windows applications) and Windows applications. The latter usually have the letter "w" at the end of the command name. For example, animate.exe is a DOS application, animatew.exe is a Windows application. DOS Command Prompt. From a DOS command prompt brought up under Windows, the options described in the section Invoking from a DOS Command Prompt above are exactly the same. These run only the DOS applications under XM. Run...Option. You can run any of the components by entering the command line in the Run... dialog available from the File pull-down menu in Program Manager. Click on the File menu in Program Manager. Click on the Run... option. Enter the command line you require and click on OK or press Enter. For DOS applications the command line to enter is: xm (xm-switches) component rest-of-command-line For Windows applications, enter: componentw rest-of-command-line where: * component is the name of the DOS-application version of the component * componentw is the name of the Windows-application version of the component * rest-of-command-line is the rest of the command line as described in the chapters for each component. Icons and Program Items. When you install your COBOL system using Setup, if you select the option to install the system on Windows, a batch file mfwin.bat is created. If you run this batch file from the DOS command prompt (by entering mfwin), three groups are set up under Windows: one for the graphical system, one for the normal Windows applications, and one for the DOS applications. Icons are created for several of the components, including the Compiler and Animator. These groups enable you to invoke the components directly from an icon, just like any other application under Windows. This is the way we recommend you invoke the components under Windows. Any components with graphical user interfaces are full Windows applications and should always be invoked from the icon. Components with character function key interfaces can be run as Windows applications, or as DOS applications by using XM. In general, the character function key components operate faster when invoked as DOS applications. All of these components can be invoked from the icons already set up. Your Own Program Items. If you have the integrated environments of Workbench or Professional COBOL (available in add-on products from Micro Focus), then you should develop your applications in these integrated environments. Icons are set up for these components as described above. If you do not have the integrated environments, use the following method for developing your applications. For components such as the Compiler and Animator, which require file-names and directives when they are invoked, you should set up a separate program item for each component and each program. So, if you are developing two programs, payroll and account, set up program items for: compiling account, compiling payroll, animating account and animating payroll. You could also set up a program item to link payroll and one to link account. Using this method you only need enter the file-name and directives once. You can then compile, animate and link as often as you like just by clicking on the icon. For better organization, you might like to place the icons referring to a specific program into a group created just for that program. Refer to your Windows documentation for full details of setting up program groups and program items. For example, you might take the following steps: 1. Set up a program group called "Tictac ". Select the New... option from the File menu. Select Program Group and click OK. Type "Tictac " in the Description entry-field. Click OK. 2. Copy the Compiler icon from the "COBOL" group. Select the Compiler icon (single click) and select the Copy... option from the File menu. Select the group Tictac from the combo box and then click OK. 3. Change the properties of the copied icon. Select the Compiler icon in the group Tictac (single click). Select the Properties... option from the File menu. Change Description to "Compile Tictac". Add "tictac" and any output files or directives you need to the end of the Command Line. Change the Working Directory to the directory containing tictac.cbl. Click OK. 4. Repeat steps 2 and 3 for Animator. 5. Add a program item for the linker. Select the group Tictac (single click). Select the New... option from the File menu. Select Program Item and click OK. Set Description to "Link Tictac". Enter the required linker command line in Command Line. Finally, enter the directory containing tictac.cbl in Working Directory and click OK. Now, you can compile, animate and link tictac just by clicking on the new icons. If you need to amend any of the directives or files, just select the icon (single-click) and enter the Properties... option from the File menu of Program Manager. You can also set up icons for other components that you want to run this way. This time, use the New... option to create the icon, entering the program name and command line defined in the chapter for the given component. Invoking from OS/2 On OS/2, the names of the character function-key components are the same as the ones for use under DOS. So, to run a component from an OS/2 prompt, just enter the command line given for the component. XM does not run under OS/2 and is not required since OS/2 automatically handles all the memory your machine has available. You can also run any graphical user interface components from the OS/2 command prompt. The command line to use is given in the relevant chapters in your Reference books. All of the executable files for these programs end with the letters "pm". When you install the COBOL system under OS/2, you are given the option of setting up program groups and icons for running the components. If you select this option, then you run any of the components by clicking on the relevant icon.


MPE/iX 5.0 Documentation