Skip to main content

Command line options to compile programs (batch compiles)

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

ProgramA is compiled with the directive $set CallFH "MyProgram".  When any file access occurs (e.g. Open i-o File) this correctly calls the "New file Handler" MyProgram.  However, the means to access the FCB of the relevant file is not at all clear.  For example, including the Directive FCDREG in the calling and called programs has no effect.

Resolution:

The following is a workable example of accessing the FCD below. The program turns on key compression in a file by setting the appropriate bits in the file's Key Definition Block.

$set

fcdreg

select masterfile

assign to ...

organization is indexed

record key is rec-key

alternate key is m-alt-key-1 with duplicates

alternate key is m-alt-key-2

alternate key is m-alt-key-3 with duplicates.

select indexfile

assign to ...

organization is indexed

record key is rec-key

alternate key is t-alt-key-1 with duplicates.

...

working-storage section.

...

linkage section.

01 key-def-block.

03 filler

pic x(6).

03 key-count

pic 9(4) comp-x.

03 filler

pic x(6).

03 key-def occurs 1 to 4 times depending on key-count.

05 filler

pic x(5).

05 key-compression

pic 9(2) comp-x.

05 filler

pic x(10).

...

procedure division.

set address of key-def-block to address of fh--keydef of masterfile

move 6 to key-compression (1)

move 7 to key-compression (2)

move 6 to key-compression (3)

move 7 to key-compression (4)

open I-O masterfile

...

set address of key-def-block to address of fh--keydef of indexfile

move 4 to key-compression (1)

move 1 to key-compression (2)

open input indexfile

Old KB# 5303

0 replies

Be the first to reply!