ファイル処理およびデータセットの環境変数

本トピックでは、ファイルおよびデータセット処理の構成に関連する環境変数の一覧を示します。

COBDATA
Specifies one or more locations, separated by ; (Windows) or : (UNIX), in which to search for data files at run time. As long as the file assignment does not contain a sub-path (that is, a string containing \ or /) then the file assignment is appended to each location specified by COBDATA in order to locate the file.
注: Users modernizing RM/COBOL or ACUCOBOL-GT legacy code can use a sub-path in the file assignment, but only by compiling with the relevant DIALECT or IDXFORMAT values for the respective File Handling systems; setting these values in the File Handling configuration file is not sufficient to achieve this.

ランタイム システムがデータ ファイルを検索するディレクトリを指定します。データ ファイルをグローバルにマップする機能を提供するため、ユーザーは実行時までに名前が認識されていないディレクトリに作業データ ファイルを置くことができます。

構文

COBDATA=pathname[:pathname]...
パラメーター
  • 検索ディレクトリのリスト (各項目はセミコロンで区切られます)。ランタイム システムでアプリケーションのデータ ファイルが検索される場合にこれらのディレクトリが検索されます。pathname を複数指定する場合に、空の pathname は現在の作業ディレクトリを示します。

説明

COBDATA は、コンパイラ、およびその他のユーティリティに影響します。たとえば、コンパイル時では、プログラム ソースがコンパイラのデータ ファイルになります。COBOL 開発システム ユーティリティを使用する場合は、COBDATA の値を、コロン (:) を先頭にして指定することをお勧めします。

ご使用の環境空間に、COBDATA という名前の環境変数があり、なんらかの値が設定されている場合は、COBDATA が設定されていると見なされます。

ファイルのすべてのマッピング順序は次のようになります。

  1. すべての dd_ 環境マッピング
  2. すべての ASSIGN TO EXTERNAL マッピング
  3. すべての COBDATA 環境変数マッピング

COBDATA 環境変数、または dd_ 環境変数のどちらかで複数のディレクトリを指定した場合、システムは、ユーザー名に対するプレフィックスとしてのスラッシュ (/) が末尾に付く最初の指定ディレクトリを検索します。

ファイル名が見つからない場合、または読み取れない場合は、上記の順番に、最後のディレクトリまで検索されます。最後のディレクトリでも見つからず、ファイルを作成する必要がある場合は、ファイルは最初のディレクトリに作成されます。

ハイフン (-)、またはスラッシュ (/) で始まっているファイル名に関しては、dd_、および COBDATA のマッピングはすべて無視されます。また、環境変数名にハイフンが含まれている場合も無効になります。

この機能を使用する場合は、COB... で始まるファイル名を使用しないでください(これらは COBOL システムで予約済みです)。

COBDATA 環境変数は、どんなモード (出力も含む) で開かれているファイルにも、また、固定長ファイルや可変長ファイルにも使用できます。索引ファイルを使用している場合は、データ ファイルおよび索引の両方を同じディレクトリに置く必要があります。

COBDATA 環境変数は、ファイルを開く場合だけでなくファイルを削除する場合にも、ここに示す規則に従って影響します。

COBOL 開発システム プログラムを使用しようとする場合はまず、COBDATA の設定を解除することをお勧めします。これらのプログラムの多くでは、データ ファイルが開かれるため、COBDATA の値に影響されます。COBDATA を使う必要がある場合は、COBDATA のパスの最初に :$COBDIR/dynload/helptbox.lbr および :$COBDIR/dynload/check.lbr を追加してください。Animator のヘルプ ページが必要な場合は、COBDIR/dynload/advanim.lbr も追加します。

注: Users modernizing RM/COBOL or ACUCOBOL-GT legacy code can use a sub-path in the file assignment, but only by compiling with the relevant DIALECT or IDXFORMAT values for the respective File Handling systems; setting these values in the File Handling configuration file is not sufficient to achieve this.

SET COBDATA=:demo:/home/data:progs

このように COBDATA を設定すると、ランタイム システムは、最初に現在のディレクトリでデータ ファイルを検索するよう指定されます。次に、ディレクトリ ./demo を、次にディレクトリ /home/data を検索し、最後に ./progs を検索するように指定されます。

DB2DBDFT
SQL 文を処理する DB2 SQL プリコンパイラのデフォルト データベース。

  • デフォルト データベースの場所と名前。
ES_DB_FH

Enables or disables database file handler support. This is required if your data files are stored in a datastore, or your enterprise server region stores some of its resources in a database; see Micro Focus Native Database File Handling and Enterprise Server Region Database Management for more information.

Syntax

SET ES_DB_FH=value

Values

  • Y|y|true - file handling is directed through the Micro Focus Database File Handler (MFDBFH).
  • N|n|false - database file handler support is disabled.

Default

Database file handler support is disabled.

ES_DB_SERVER

Specify the name of the database server to be used for region database operations.

There also needs to be a corresponding <server> entry for the database server within the configuration file specified by the MFDBFH_CONFIG environment variable. <dsn> entries for the region, cross-region and master databases must also be specified in the configuration file to enable use of region database operations.

Syntax

SET ES_DB_SERVER=server-instance

Values

server-instance is the name of a valid database server instance. For example, set ES_DB_SERVER=(local)\SQLEXPRESS.

Default

Not set.

Example

Using the example above, you would be required to have something similar to that below in your mfdbfh.cfg file:

<?xml version="1.0" encoding="utf-8"?> 
<datastores>
   <server name="(local)\SQLEXPRESS" type="sqlserver" access="odbc"> 
       <dsn name="SS.MYMASTER" type="database" dbname="master"/> 
       <dsn name="SS.CAS.ESDEMO" type="region.cas" region="ESDEMO" feature="all"/> 
       <dsn name="SS.CAS.CROSSREGION" type="crossregion.cas"/>
   </server> 
</datastores>
ES_RLS_FILE_SUPPORT
あるプログラムが更新目的で読み取りを行っているためにレコードがロックされている際に、他のプログラムがそのレコードにアクセスできないようにする必要がある場合は、この環境変数を設定して、ロックを保持しているプログラムが完了するまで無効なレコードが返されるのを防止できます。ファイル共有のタイムアウトも、ファイル共有構成ファイルで /t 0 を使用して 0 に設定する必要があります。

構文

SET ES_RLS_FILE_SUPPORT=value

  • Y|y - レコードが別のプロセスによってロックされている場合に無効なレコードが返されないようにします。

デフォルト

RLS ファイル サポートはオフです。

EXTFH
呼び出し可能ファイル ハンドラーの構成ファイルを指定します。

構文

SET EXTFH=filename.cfg

パラメーター

filename.cfg 構成ファイルの名前。

SET EXTFH=/home/mydir/myconfig.cfg
FHREDIR
Fileshare クライアントに使用させる構成ファイルを指定します。

構文

SET FHREDIR=filename.cfg

パラメーター

filename.cfg 構成ファイルの名前。

SET FHREDIR=/home/mydir/myconfig.cfg
FS

Fileshare Server に使用させる構成ファイルを指定します。

構文

SET FS=filename.cfg

パラメーター

filename.cfg 構成ファイルの名前。

SET FS=myconfig.cfg
FSCOMMS
Fileshare システムがシングル ユーザー モードで実行されることを指定します。

構文

SET FSCOMMS="\$local"

パラメーター

"\$local" Fileshare システムをシングル ユーザー モードで実行します。

GDG.RECALL
MFA データ アクセス サービスを使用してメインフレーム GDG にアクセスするときに、HSM アーカイブ済みデータセットの再呼び出しを制御します。
HCOBND (非推奨)
DB2 外部コンパイラー モジュール (ECM) で生成されるバインド ファイルに使用するディレクトリを指定します。
注: HCOBND は非推奨です。下位互換性のみを目的として提供されています。代わりに BIND または BINDDIR コンパイラ指令オプションのいずれかを使用することをお勧めします。

構文

SET HCOBND=pathname
HCOBND=pathname
export HCOBND

パラメーター

pathname バインド ファイルを格納するために DB2 ECM で使用するディレクトリ。

SET HCOBND=d:\mydir\binds

説明

DB2 ECM は、この環境変数が設定解除されるか、または別のディレクトリが再設定されるまでは指定されたディレクトリを使用します。DB2 コンパイラの指令オプション BIND はこの環境変数をオーバーライドします。

LIB
DB2 LIB ディレクトリの場所。
MF_CBLQDA
オプション ファイル (FILE-CONTROL 段落で SELECT OPTIONAL 構文を使用して開かれたファイル) または OUTPUT 用に開かれたファイル (オプションかどうかは問わない) の OPEN I-O 文または OPEN EXTEND 文を処理する際に QSAM ファイルを動的に割り当てるかどうかを決定します。指定できる値は OFF および ON です。デフォルトは OFF で、動的割り当てを許可しないように指定します。
これは、CBLQDA 言語環境 (LE) ランタイム オプションのエミュレーションです。
ON に設定した場合に、JCL に含まれている開くファイルの DD 文にスペルミスがあるか、JCL にその文が含まれていないと、OPEN 文の結果として一時ファイルが作成され、プログラムの実行後に削除されます。I-O または EXTEND 用に開かれたオプション ファイルの場合は、戻りコード 05 が返されます。OUTPUT 用に開かれたファイルの場合は、戻りコード 00 が返されます。
この変数は、VSAM アプリケーションまたは JCL ユーティリティ プログラムには影響しません。
注: ESDS ファイルを使用し、この変数を ON に設定しているプログラムでは、FILETYPE が 15 または 16 に設定されていることを確認してください。それ以外の場合、このファイルは変数の影響を受け、QSAM ファイルとして扱われます。
MF_NEWSPACE
新規データセットにスペースが必要かどうかを示します。
MF_SYSLOGDSN
Syslog データセット名。
MFALLOC_LOC
The default allocated data set location.
For a database-hosted data set location, you need to include the full SQL URL, for example, set MFALLOC_LOC=sql://localhost/JCLTEST?folder=/JCLDEMO/data
MFALLOC_PROP
割り当て時に生成される PC データセット名の規則 (つまり、デフォルトのカタログ PC DSN フォーマット)。
MFDBFH_CONFIG

Specifies the location and the name of the configuration file that defines the database server instances and associated databases.

Syntax

SET MFDBFH_CONFIG=value

Values

value represents the full path and filename of your database configuration file.

Default

Not set.

MFDBFH_CONNECTION_POOLING

Specify whether database connection pooling is to be enabled or not when the database file handler is in effect.

Syntax

SET MFDBFH_CONNECTION_POOLING=TRUE|FALSE

Paramaters

TRUE
Connection pooling is enabled, which keeps database connections open, and then reuses them where possible in preference of creating a new connection.
FALSE
Connection pooling disabled. This setting comes at a cost to performance, as a new physical connection is established each time. You may want to disable connection pooling during testing, when databases are more frequently added and dropped: if pooling is enabled, and existing connections remain open, it may stop you from dropping that particular database.

Default

MFDBFH_CONNECTION_POOLING=TRUE

MFDBFH_RECORD_LOCKING

Specifies the type of record locking that it is to be used when the database file handler is in effect.

Syntax

SET MFDBFH_CONFIG=table|database

Paramaters

table
A file's record locks are held in a seperate lock table. (When using this locking mode, the behavior of record locking COBOL file operations closely follows the same behavior when using Fileshare.)
database
The native record locking mechanism of the database engine is used to establish and test locks on the data file records. This method improves performance, but at the cost of the locking behavior not exactly matching that of traditional COBOL record locking; see Database Record Locking for a list of differences for each database engine.

Default

MFDBFH_RECORD_LOCKING=table
注: If the value of this variable is set to anything other than 'database', this default is used.
MFDBFH_SCRIPT_DIR

Specifies the location of the scripts and stored procedures required when the database file handler is in effect.

Syntax

SET MFDBFH_SCRIPT_DIR=value

Values

value represents a path to the directory containing the required resources.

Default

value defaults to the \etc\mfdbfh\scripts sub directory of your product installation directory.

MFLOCKING
ロッキング サポートを有効にします。
PROCLIB
PROCLIB データセットを指定します。これは、PDS 名の連結にすることができます。
strictvsam
VSAM ファイルのファイル処理中の厳密なメインフレーム エミュレーションを指定します。

構文:

strictvsam=ON|OFF

パラメーター:

ON
次の場合に、既存の VSAM ファイルが OUTPUT 用に開かれると、ファイル状態 37 が返されます。
  • ファイルにデータがあるか、以前にデータが書き込まれた。
  • ファイルの形式がディスク上のファイルと異なる。
OFF
既存の VSAM ファイルが OUTPUT 用に開かれると、ファイル状態 0 が返され、新しいファイルが作成されます。

プロパティ:

デフォルト: OFF
IDE での相当機能: なし
TXFILEP
The location of Micro Focus VSAM files. This can be a location on disk or a datastore location within a database. For database-hosted files, use the notation sql://host[/instance]/datastore[?folder=/path] - see The dbfhdeploy Command Line Utility for more information.
XFHLOG
Determines the location of the log file when the LOG option is active.

Syntax:

SET XFHLOG=DEFAULT

Parameters:

DEFAULT - generates the log file in the current directory.

Comments:

If the XFHLOG variable is not set, the log file is created in C:\ProgramData\Micro Focus\File Handler\[version-number].

where [version-number] represents the version of your Micro Focus product.

The effect of this variable can be overridden by the LOGFILENAME configuration option.