Directives & Configuring
Micro Focus Compiler & File Handler
  Table of Contents  v-24.01.01 - dirpil01.htm 
  Introduction
  Starting with Four Directives Files
  Batch without SQL
  Batch with SQL
  Online without SQL
  Online with SQL
  Directives, Data Access & Formats
  Data Access, no File Open, 114 Error
  Directives, Numeric Formats
  Configure, Data File Alternatives
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document provides information about how to specify and use the Micro Focus COBOL compiler directives that may be required to control program behavior in the Linux, UNIX or Windows environments in a manner compliant with the compiler options and subsequent execution on the Mainframe System. In the world of computer systems and programming there are many alternatives for providing solutions. The approaches described in this document offer a few alternatives.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Starting with Four Directives Files

Compiler directives may be individually specified in the source code of a COBOL program, as part of a Net Express project or grouped together in a directives file that may be referenced by the project or command that is doing the compile. For most of the compiles this suite of examples uses directives files, two for the batch environment and two for the online environment. The following sections describe each in more detail.

When the NOFORM directive is used the listing will be created without print carriage control and page headers. This makes for easier viewing from the screen and produces a listing file with the included copy files. This listing file could be renamed with a .CBL extension and compiled.

Note: The NOFORM directive must follow the LIST() directive. The LIST directive will set FORM"60".

Table of Contents Previous Section Next Section Batch without SQL

The following (OS390AscCBLBAT.dir) is a listing of the DIR file used when compiling COBOL batch programs for an ASCII-encoded environment. These are programs without "EXEC CICS" and without "EXEC SQL" syntax.

DIALECT"OS390"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IDXFORMAT"8"
IBMCOMP
NOTRUNC
HOSTNUMMOVE
HOSTNUMCOMPARE
NOSIGN-FIXUP
HOSTARITHMETIC
CHECKNUM
NOOPTIONAL-FILE
NOHOSTFD
NOQUERY
SSRANGE
COBIDY
ANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATE
TIME
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Batch with SQL

The following (OS390AscCBLBSQ.dir) is a listing of the DIR file used when compiling COBOL batch programs for an ASCII-encoded environment. These are programs without "EXEC CICS" and with "EXEC SQL" syntax.

DIALECT"OS390"
CHARSET"ASCII"
SQL(DBMAN=ODBC, autocommit)
SQL(ALLOWNULLCHAR)
SQL(PASS)
SQL(INIT=PROT)
SQL(THREAD=ISOLATE)
SQL(BEHAVIOR=MAINFRAME)
WARNING"1"
IBMCOMP
NOTRUNC
HOSTNUMMOVE
HOSTNUMCOMPARE
NOSIGN-FIXUP
HOSTARITHMETIC
CHECKNUM
NOOPTIONAL-FILE
NOHOSTFD
NOQUERY
COBIDY
ANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
SETTING"COL3"
list()
noform

Table of Contents Previous Section Next Section Online without SQL

The following (OS390AscCBLONL.dir) is a listing of the DIR file used when compiling COBOL onlne programs for an ASCII-encoded environment. These are programs with "EXEC CICS" and without "EXEC SQL" syntax.

DIALECT"OS390"
CHARSET"ASCII"
CICSECM()
IBMCOMP
NOTRUNC
HOSTNUMMOVE
HOSTNUMCOMPARE
NOSIGN-FIXUP
HOSTARITHMETIC
CHECKNUM
NOQUERY
COBIDY
ANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Online with SQL

The following (OS390AscCBLOSQ.dir) is a listing of the DIR file used when compiling COBOL onlne programs for an ASCII-encoded environment. These are programs with "EXEC CICS" and with "EXEC SQL" syntax.

DIALECT"OS390"
CHARSET"ASCII"
SQL(DBMAN=ODBC, AUTOCOMMIT)
SQL(THREAD=ISOLATE)
SQL(INIT=PROT)
SQL(BEHAVIOR=MAINFRAME)
WARNING"1"
CICSECM()
IBMCOMP
NOTRUNC
HOSTNUMMOVE
HOSTNUMCOMPARE
NOSIGN-FIXUP
HOSTARITHMETIC
CHECKNUM
NOQUERY
COBIDY
ANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings(COL3)
list()
noform

Table of Contents Previous Section Next Section Directives, Data Access & Formats

This section describes various Micro Focus compiler directives that may be required to control program behavior in the Linux, UNIX or Windows environments in a manner compliant with the compiler options and subsequent execution on the Mainframe System. The following directives will affect the way programs process and format numeric fields. Once the data is stored in a data file on s permanent storage media the format of the records and their content structure must be maintained.

Table of Contents Previous Section Next Section Data Access, no File Open, 114 Error

If a program attempts to access the record buffers defined in the FD section of a COBOL program this will result in a 114 error return code if the file has not been opened. Normally, this memory area is not allocated and available until after the file is opened. This causes the 114 error message and can be very time consuming to diagnose. To make the record buffers available before a file open a compiler directive (NOHOSTFD) must be used.

Table of Contents Previous Section Next Section Directives, Numeric Formats

Management (i.e. processing, storage and retrieval) of the various numeric formats has been and continues to be a challenge on the mainframe. When transferring data files that contain the various numeric formats from the Mainframe to a Windows or UNIX platform the challenges are transferred along with the files. Micro Focus (on the Windows and UNIX platforms) offers a number of COBOL compiler directives to help deal with the challenges of managing the various numeric formats.

NUMPROC is a mainframe compiler option. When NUMPROC(MIG) is in effect, the compiler generates code that is similar to that produced by OS/VS COBOL. This option can be especially useful if you migrate OS/VS COBOL programs to IBM Enterprise COBOL for z/OS.

Use NUMPROC(MIG) to aid in migrating OS/VS COBOL programs to Enterprise COBOL. When NUMPROC(MIG) is in effect, the following processing occurs at the mainframe:

Number Description
1 Preferred signs are created only on the output of MOVE statements and arithmetic operations.
2 No explicit sign repair is done on input.
3 Some implicit sign repair might occur during conversion.
4 Numeric comparisons are performed by a decimal comparison, not a logical comparison.
  When NUMPROC(MIG) is in effect, the preceding processing occurs at the mainframe

For Micro Focus the use of a mainframe dialect DIALECT(ENTCOBOL) will set other compiler options for mainframe compatibility. For example IBMCOMP and NOTRUNC directives will be included when a mainframe dialect is use. This will maintain numeric integrity and size for COMP or BINARY fields. Next the use of the directives HOSTNUMMOVE HOSTNUMCOMPARE SIGNFIXUP HOSTARITHMETIC CHECKNUM will emulate the mainframe NUMPROC(NOPFD)

The sequence in which the directives are specified is also important since some directives will set other directives. For example, the DIALECT directive that specifies a mainframe dialect will set CHARSET(EBCDIC). If the desired encoding is ASCII then the CHARSET(ASCII) directive must follow the DIALECT directive.

DIALECT
  The DIALECT(ENTCOBOL) should be the first directive specified. This will ensure a mainframe dialect.
CHARSET
  If the target environment is ASCII-encoded then use the CHARSET(ASCII) directive must follow the DIALECT directive that specifies a mainframe dialect.
IBMCOMP
  In word-storage mode every data item of USAGE COMP or COMP-5 occupies either two bytes or a multiple of four bytes.
NOTRUNC
  Truncate in binary to the capacity of the allocated storage, on all nonarithmetic stores into COMP, BINARY and COMP-4 items.
DE-EDIT
  The DE-EDIT'1' directive may be required if the program being compiled does moving between edited numeric fields.
NUMPROC(PFD)
  Given X'sd', where s is the sign representation and d represents the digit, when you use NUMPROC(PFD), the compiler assumes that the sign in your data is one of the three preferred signs:
1. Signed positive or 0: X'C'
2. Signed negative: X'D'
3. Unsigned or alphanumeric: X'F'
The following is a list of the directives used to emulate the NUMPROC(PFD) environment.
HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM.
NUMPROC(NOPFD)
  On the mainframe when the NUMPROC(NOPFD) compiler option is in effect, the compiler accepts any valid sign configuration. The preferred sign is always generated in the receiver. NUMPROC(NOPFD) is less efficient than NUMPROC(PFD), but you should use it whenever data that does not use preferred signs might exist. If an unsigned, external-decimal (or zoned-decimal) sender is moved to an alphanumeric receiver, the sign is unchanged (even with NUMPROC(NOPFD)).
The following is a list of the directives used to emulate the NUMPROC(NOPFD) environment.
HOSTNUMMOVE HOSTNUMCOMPARE SIGNFIXUP HOSTARITHMETIC CHECKNUM.
DEFAULTBYTE"ii"
  The "ii" is a decimal value.
Set to DEFAULTBYTE"32" immediately by CHARSET"ASCII".
Set to DEFAULTBYTE"00" immediately by CHARSET"EBCDIC", MS, IBM-MS or PC1.
If you want to specify an EBCDIC space use DEFAULTBYTE"64".
Note 1: If the default byte is to be changed and the CHARSET directive is used then DEFAULTBYTE must follow the CHARSET directive.
Note 2: If a COBOL program processes a table and the index (or subscript for the table) is not initialized this will not produce an abnormal termination on the mainframe. However, if the program is ported to a Micro Focus environment with ASCII encoding the index will be initialized to spaces and this will cause a problem with an invalid subscript error. Changing the default byte to "00" for the ASCII encoded environment will correct the problem. Correcting the program to initialize the index (or subscript) would be a better solution to the problem.
NOSIGN-FIXUP
  The NOSIGN-FIXUP is the preferred option. The SIGN-FIXUP should only be used on an exception basis. The SIGN-FIXUP directive will avoid a 163 error message. However, it will continue to proliferate the problem of allowing spaces or low-values to be used in numeric fields.
  An Overview of Compiler Directives/Options for Numeric Processing

When trying to do an arithmetic operation on a packed field that has a non-numeric value or an invalid sign the operation will ABEND with a S0C7 Program check on the Mainframe System. The operation will ABEND with a 163 RTS error on a Micro Focus System.

On the Mainframe System the NUMPROC(NOPFD) Compiler option may be used to avoid the S0C7 ABEND.

In the Micro Focus environment the SIGNFIXUP Compiler directive may be used in conjunction with not using the CHECKNUM Compiler directive.

Note: the process that causes the packed fields to contain SPACE characters should be addressed. The Compiler options only prevent the ABEND but may produce incorrect results when used in arithmetic processing.

Table of Contents Previous Section Next Section Configure, Data File Alternatives

The file extfh.cfg is the file handler configuration file. By default, the file handler looks for it in the current directory. You can use the EXTFH environment variable to specify its path and/or name explicitly. For example: the following will explicitly define the location of the configuration file.

 set EXTFH=c:\mydir\test.cfg 

The following shows the content of a sample EXTFH configuration file.

[XFH-DEFAULT]
filemaxsize=8
idxformat=8
filepointersize=8
INDEXCOUNT=32
IGNORELOCK=ON
READSEMA=OFF
USEVSAMKEYDEFS=OFF

Table of Contents Previous Section Next Section Summary

This document provides information about how to specify and use the Micro Focus COBOL compiler directives that may be required to control program behavior in the Linux, UNIX or Windows environments in a manner compliant with the compiler options and subsequent execution on the Mainframe System. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore a Scripted Application Build Process for an application that has been moved from a Mainframe System to a Windows system running a Micro Focus sub-system such as Enterprise Server, Application Server or Net Express.

Link to Internet   Link to Server   Explore the File Formats and various Numeric Formats being used in a multi-system complex consisting of Mainframe (z/OS), Linux, UNIX or Windows systems.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Directives & Configuration Alternatives, the Micro Focus Compiler and External File Handler - EXTFH
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com