Top
NetCOBOL V11.0 Syntax Samples
FUJITSU Software

1.10 Function Name-2 Clause

The function name-2 clause allows the use of external switches.

An external switch controls information that can be switched at execution. The external switch is specified by the run-time option when an application is started.

A run-time option is specified by one of the following methods:

Refer to "NetCOBOL User's Guide" for details on run-time options.

In the sample below, the message is output with upper-case letters if s10000000 is specified for the run-time option. If s00000000 is specified or nothing is specified for the run-time option, the message is output with lower-case letters.

000010 @OPTIONS MAIN
000020*----------------------------------------------------------------------
000030* In this sample, the message is switched using an external switch.
000040*----------------------------------------------------------------------
000050 IDENTIFICATION   DIVISION.
000060 PROGRAM-ID       SAMPLE.
000070 ENVIRONMENT      DIVISION.
000080 CONFIGURATION    SECTION.
000090*----------------------------------------------------------------------
000100* The external switch is defined.
000110* Only one external switch is defined here.  However, up to eight
000115* external switches can be defined.
000120*----------------------------------------------------------------------
000130  SPECIAL-NAMES.
000140          SWITCH-0 IS SW0 ON  STATUS IS U-CASE
000150                          OFF STATUS IS L-CASE.
000160*----------------------------------------------------------------------
000170 PROCEDURE       DIVISION.
000180     IF U-CASE THEN
000190       DISPLAY "HELLO, I AM A NETCOBOL PROGRAM."
000200     ELSE
000210       DISPLAY "Hello, I am a NetCOBOL program."
000220     END-IF
000230 END PROGRAM SAMPLE.