This section explains the procedure for executing a COBOL program.
Executing a COBOL program
To execute a COBOL program:
Select the COBOL project in the "Dependency" or "Structure" view.
Select "Run" > "Run Configurations..." from the menu bar. The "Run Configurations" dialog box appears.
Double-click "COBOL Application" in the left pane. The startup configuration setting page displays in the right pane.
The project name is the initial value displayed in the "Name" field. The startup configuration name can be changed.
Click the "Main" tab.
Enter the COBOL project name in the "Project name" field. Alternatively, click the "Browse..." button and select the COBOL project.
If the TARGET of the specified project is a dynamic link library, specify the "Executable File".
Specify the current folder at the execution time in the "Working folder" field. If the dynamic link libraries required for execution are stored in this folder, they can be loaded during execution time.
For "Program arguments", enter parameters in the format used for the command line interface.
Click the "Run" button to execute the program.
Once the COBOL program has been executed using the steps detailed above, it can also be executed using the following steps:
From the menu bar, select "Run" > "Run history".
Select the startup configuration name that was specified in "Name" field in Procedure 4 above.
If the COBOL program is executed using any method other than those described here, the values set in the Run dialog box do not take effect.
Note
For example, a user may execute a COBOL program by double-clicking an executable file from a view. In this case, the work directory settings specified in the Run dialog box are not reflected. Problems may occur, if for example, the relative path name specified in the runtime initialization file (COBOL85.CBR) is not the intended path.
Setting the COBOL application startup configuration
Setting items of the COBOL application startup configuration.
Main tab
item | Description |
---|---|
Project name | The select project name is displayed. |
Executable File | It is a program executed first at the debugging. When the target is an execution file, cannot be changed. When the target is a dynamic link library, specify an appropriate File. |
Working folder | Specify the current folder at execution time. When you store the dynamic link library in this folder, the load of dynamic link library can be done at execution time even if other paths are not set. |
Program arguments | The argument of the program is input. |
Source tab
item | Description |
---|---|
Source lookup path | This page contains the paths used to search source files in debugging. The information in the "Source" tab is not used at execution time |
Environment tab
item | Description | |
---|---|---|
Environment variables to set | This item contains information that is used by the COBOL runtime module to obtain environment-specific information at the start of processing. For details on environment-specific information, see the "NetCOBOL User's Guide". | |
Variable | ||
Value | ||
Append environment to native environment | To add the environment variable information set here to existing system environment variables or user environment variables. | |
Replace native environment with specified environment | To replace the existing environment. |
Note
If the same environment variable is set in both the "Environment" tab and the runtime initialization file, the information in the runtime initialization file is used.
Common tab
The "Common" tab specifies how to save startup configuration information, the perspective to open after the start of execution or debugging, and other related settings.
item | Description | |
---|---|---|
Save as | Either Local file or Shared file is selected for the startup configuration type. If "Local file" is selected, startup configuration information is saved locally in workspace metadata. If "Shared file" is selected, startup configuration information is saved at the specified location, and can be shared. | |
Local file | ||
Shared file | ||
Display in favorites menu | To add Run or Debug to the favorites menu, select "Run" or "Debug". These items are not selected by default. | |
Debug | ||
Run | ||
Console Encoding | Default is "Cp1252". | |
Standard Input and Output | In the COBOL application startup configuration, any changes made to the standard input-output settings are ignored. | |
Allocate Console | ||
File | ||
Append | ||
Launch in background | To start COBOL applications in the background, select Launch in back ground. Launch in background is selected by default. |