Previous Topic Next topic Print topic


Run a Test Program to Verify Replication

Once you have verified that the high availability group is configured correctly, run the following COBOL program to demonstrate that the replication process is working correctly within the group. This program creates a data file, the name of which was added to the dbase.ref file in an earlier step. When the program has finished, the data file (file.dat) should have been created on the primary server (RED), then replicated to the standby servers (GREEN and BLUE).
  1. In a separate directory to any of the system directories (for example, c:\HA on Windows platforms), create a new file called runner.cbl, then paste the following code into it and save the file:
          $set callfh"FHREDIR"
           environment division.
           configuration section.
           input-output section.
           file-control.
    
               select optional idxfile
                   assign to disk "file.dat"
                   organization is indexed
                   access is dynamic
                   lock mode is automatic
                   record key is idxfile-primary-key
                   file status is file-status.
    
           data division.
           file section.
    
           fd  idxfile.
           01  idxfile-rec.
               03  idxfile-primary-key pic 999999999.
           
           working-storage section.
               01 file-status.
                    05 status-key-1     pic x.
                    05 status-key-2     pic x.
                    05 binary-status redefines status-key-2  pic 99 comp-x.
               
           Procedure Division.
               open output idxfile
               move 0 to idxfile-primary-key
               perform 100 times
                  perform 20 times
                  add 1 to idxfile-primary-key
                      write idxfile-rec
                  end-perform
                  commit
               end-perform
               close idxfile
               stop run.
  2. From an Enterprise Developer command or shell prompt, type:

    Windows:

    cobol runner.cbl int();

    UNIX:

    cob runner.cbl;

    The COBOL file is compiled to an .int file.

  3. In the same directory, create the fhredir.cfg file that is specified in the COBOL program, then paste the following options into it and save the file.
    /s FS1
    /um
    /ra 5
    /rd 5000
    /cm ccitcp

    See Fileshare Client Configuration Options for details on each option.

  4. Run the program by typing the following:

    Windows:

    run runner.int

    UNIX:

    cobrun runner.int
    Tip: While the program is running, on the Enterprise Server Administration home page, for the primary server, click Details > ES Monitor & Control > iFSView > files get to show the open file within Fileshare.

  5. When the program has completed, check the system directory for each server: they should each contain file.dat. This verifies that replication is working correctly within the group.
Previous Topic Next topic Print topic