Admin Production rocket
Current Publication

BEGIN DECLARE SECTION

Enterprise Developer for Visual Studio 2017 (Japanese) V8.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

BEGIN DECLARE SECTION

宣言節の開始を表します。

構文:

>>---EXEC SQL---BEGIN DECLARE SECTION---END-EXEC---><

説明:

BEGIN DECLARE SECTION 文は、COBOL の変数宣言を使用できる任意の場所に含められます。COBOL の宣言節の終わりを表すには、END DECLARE SECTION を使用します。

  • 宣言節はネストできません。
  • 変数は、SQL ではなく COBOL で宣言する必要があります。
  • 競合を避けるため、宣言節内の変数は、コンパイル単位が異なる場合でも、宣言節の外部または他の宣言節の変数と同じにすることはできません。

宣言節内でデータ構造体が定義されている場合、ホスト変数として使用できるのは最下位レベルの項目 (PIC 句付き) のみです。ただし、FETCH 文で指定された配列、および SELECT INTO 文で指定されたレコード構造は例外となります。

例:

 WORKING-STORAGE SECTION.
 EXEC SQL BEGIN DECLARE SECTION END-EXEC
 01 staff-id        pic x(4).
 01 last-name       pic x(30).
 EXEC SQL END DECLARE SECTION END-EXEC