2.7.3 Executing the VIEW Compiler

To compile a VIEW typed buffer, run the viewc command, specifying the name of the view description file as an argument. To specify an independent VIEW, use the -n option. You can optionally specify a directory in which the resulting output file should be written. By default, the output file is written to the current directory.

For example, for an FML-dependent VIEW, the compiler is invoked as follows:

viewc myview.v

Note:

To compile a VIEW32 typed buffer, run the viewc32 command.

For an independent VIEW, use the -n option on the command line, as follows:

viewc -n myview.v

The output of the viewc command includes:

  • One or more COBOL COPY files; for example, MYVIEW.cbl
  • Header file containing a structure definition that may be used by application programs
  • Binary version of the source description file; for example, myview.V

    Note:

    On case-insensitive platforms (for example, Microsoft Windows), the extension used for the names of such files is vv; for example, myview.vv.

Listing provides an example of the header file created by viewc.

Listing Header File Created Using the VIEW Compiler

struct MYVIEW {
 float          float1;
 double         double1;
 long           long1;
 short          short1;
 int            int1;
 dec_t          dec1;
 char           char1;
 char           string1[20];
 unsigned       short L_carray1[2];   /* length array of carray1 */
 short         C_carray1;            /* count of carray1 */
 char          carray1[2][20];
bool                 bool1
signedchar           signedchar1
unsignedchar         unsignedchar1
wchar_t              wchar_t1
unsignedint          unsignedint1
unsignedlong         unsignedlong1
longlong             longlong1
unsignedlonglong     unsignedlonglong1
longdouble           longdouble1
struct               struct1
};

The same header file is created for FML-dependent and independent VIEWs.

To use a VIEW typed buffer in client programs or service subroutines, you must specify the header file in the application #include statements.