Processing Large Files
Micro Focus and Windows
  Table of Contents  v-24.01.01 - ksdbig01.htm 
  Introduction
  Environment Settings
  External File Handler (EXTFH)
  Mainframe Access (MFA)
  Performance (Sample Timings)
  The JCL Member
  The COBOL Test Program
  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 is an example of how Micro Focus COBOL can create and access large indexed files on a Windows platform. We started the process of testing an application on a Windows platform with small files and were planning to do the final testing with a copy of the larger production files. When we started the final testing we ran into the 2-gig limit and after a little research, frustration, trial-and-error and reading the documentation we successfully completed the final testing on a Windows/XP, Windows/7 and Windows Server platform. The drives that contained the large files were formatted for NTFS.

Note: It is a good practice to use NTFS formatted disks for large files (over 2 gigabytes). Many USB drives are shipped with FAT formatting that does not allow large files (over 2 gigabytes), these disks will need to be reformatted before attempting to allocate or copy large files.

Here is what we had to do. The configuration file (EXTFH.CFG) file was located in the same directory as the file being created. An environment variable may be used to point to a specific configuration file. Refer to the Environment Settings section of this document for more information.

Our Net Express was Version 5.1. From within the Net Express project we selected "Project" and "Project Properties" and added the FILETYPE(8) directive to the Project Directives. The FILETYPE(8) is apparently a replacement for the IDXFORMAT(8) directive according to the Net Express documentation. Also, it appears that setting this directive in the project can be used in place of the $SET statement in the COBOL program. It appears this "large file" support for keyed-indexed files is both a compile and run time dependent issue. For Sequential files only the run time (EXTFH.CFG) is required.

When we first tried to look at the file with the Micro Focus Data File Editor we discovered the default was to backup the file prior to allowing access to the file. For a file with 15,000,000 records this could take a few minutes. This was solved by changing the "Options" and Data Tools configuration to not do the backup. Next, if you look at the beginning or end of the file it is very quick. However, if you use the vertical scroll bar to reposition to the middle of the file it could take a couple of minutes while you are presented with the message, "Seeking through file...".

We also encountered another frustration when we put the display statement in the COBOL program to help in debugging. The display items did not display when we were running the .EXE (Note: we did the EXE to test performance). To correct this and have the item display to the screen we set the link options to static, single-thread, character. In Summary, it does work when all the pieces are properly coordinated.

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.


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 Environment Settings

When working with files larger than 2-gigabytes it will be necessary to set environment variables to allocate the larger file sizes.

Table of Contents Previous Section Next Section External File Handler (EXTFH)

For keyed-indexed (or VSAM, KSDS) files the IDXFORMAT(8) compiler directive will be required when processing files larger than two gigabytes in size. For keyed-indexed files and sequential files the following will be required. The EXTFH.CFG file contains the following four statements.

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

The EXTFH.CFG file was located in the same directory as the file being created. An environment variable may be used to point to a specific configuration file. For example, the following set statement could be used.

 set EXTFH=c:\mydir\test.cfg 

Table of Contents Previous Section Next Section Mainframe Access (MFA)

When using Mainframe Express and Mainframe Access to transfer a file from the Mainframe to a Windows platform the following environment variable is required to allocate indexed files larger than 2 gigabytes.

set MFA_INDEX_FORMAT=IDXFORMAT(8) 

Table of Contents Previous Section Next Section Performance (Sample Timings)

The following timings were performed on an IBM ThinkPad running at 1.6 megahertz with 512 megabytes of memory. The operating system was Windows XP with Service Pack 1. The data files were Micro Focus Indexed Files using the IDXFORMAT(8) directive. The record length was 256 bytes and the key length was 12 bytes starting in position 1 of the record. All the files were located on the C-drive. The drive was 30 gig with 15 gig of free space at the start of each "create, convert and compare" cycle.

The "Create a File" function uses a Micro Focus COBOL program to generate a key and a text string that is shifted one byte to the left for each record. The "Copy and Convert" function will read the file created in the preceding step, convert the data between EBCDIC and ASCII and write a new file. The "Compare Files" function will read two files and compare the contents of each record.

The elapsed times are hh:mm:ss format.

Number of Records File Size Create a File
Elapsed Time
Copy and Convert
Elapsed Time
Compare Files
Elapsed Time
50,000 13.8 meg 00:00:02 00:00:17 00:00:02
250,000 69 meg 00:00:10 00:01:24 00:00:11
1,000,000 276 meg 00:00:46 00:06:25 00:02:08
5,000,000 1.38 gig 00:03:01 00:32:18 00:16:58
15,000,000 4.14 gig 00:04:09 01:35:37 00:30:14

After creating the file with 15 million records we used the Windows copy function to copy the file from the C-drive to a larger, backup drive attached to a USB 2.0 port. This copy took 12 minutes and 56 seconds.

Table of Contents Previous Section Next Section The JCL Member

The following is the mainframe JCL (KSDBIGJ1.jcl) that is used to run the job on a Mainframe System with ZOS or a Linux, UNIX or Windows System with Micro Focus Server.

//KSDBIGJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       This JCL member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Execute a COBOL program to create a large, VSAM, KSDS.
//* Author - SimoTime Technologies
//* Date   - January 01, 1997
//*
//* This cobol program will create a large, VSAM, KSDS with a
//* 256-BYTE data record.
//* The number of records added to the file is determined by the
//* RECORD-LIMIT in the COBOL program.
//*
//* Mainframe Name is: SIMOTIME.DATA.VKSD0256
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//*             ************
//*             * KSDBIGJ1 *
//*             ********jcl*
//*                  *
//*                  *
//*             ************     ************
//*             * KSDBIGC1 *-----* VKSD0256 *
//*             ********cbl*     *******ksds*
//*
//* For SMS data sets use the following statement.
//*            STORCLAS=MFI,
//* For NON-SMS data sets use the following statement.
//*            UNIT=3390,VOL=SER=LARRYS,
//* For maximum file size use the following:
//*             SPACE=(TRK,(65535,0),RLSE),
//*
//VSAMCRT1 EXEC PGM=KSDBIGC1,PARM=50000
//STEPLIB  DD  DISP=SHR,DSN=MFI01.SIMOPROD.LOADLIB1
//VKSD0256 DD  DSN=SIMOTIME.DATA.VKSD0256,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section The COBOL Test Program

This program (KSDBIGC1.CBL) was written to test the capability of creating and processing very large indexed files.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    KSDBIGC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any non-commercial purpose and without fee is hereby      *
      * granted, 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.                                                 *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. Once the fee is received by SimoTime   *
      * the latest version of the software 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 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                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
      *
      *****************************************************************
      * Source Member: KSDBIGC1.CBL
      *****************************************************************
      *
      * KSDBIGC1 - Execute KSDBIGC1 to add records to a
      * VSAM Keyed Sequential Data Set (KSDS).
      *
      * EXECUTION or CALLING PROTOCOL
      * -----------------------------
      * Use standard JCL to EXECUTE or ANIMATE.
      *
      * DESCRIPTION
      * -----------
      * This single COBOL program will add records to a VSAM, KSDS.
      * The number of records added is determined by the RECORD-LIMIT.
      *
      *    ************
      *    * KSDBIGJ1 *
      *    ********jcl*
      *         *
      *         *
      *    ************     ************
      *    * KSDBIGC1 *-----* VKSD0256 *
      *    ********cbl*     *******vsam*
      *
      *
      *****************************************************************
      *
      * MAINTENANCE
      * -----------
      * 1997/02/27 Simmons, Created program.
      * 1997/02/27 Simmons, No changes to date.
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT   SECTION.
       FILE-CONTROL.

      *****************************************************************
           SELECT VKSD0256-FILE ASSIGN to VKSD0256
                          ORGANIZATION is INDEXED
                           ACCESS MODE is SEQUENTIAL
                            RECORD KEY is VKSD0256-KEY
                           FILE STATUS is VKSD0256-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.

      *****************************************************************
       FD  VKSD0256-FILE.
       01  VKSD0256-RECORD.
           05  VKSD0256-KEY        PIC 9(12).
           05  VKSD0256-DATA       PIC X(244).

       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *****************************************************************
       01  SIM-TITLE.
           05  T1 pic X(11) value '* KSDBIGC1 '.
           05  T2 pic X(34) value 'Sample, Create a large KSDS file  '.
           05  T3 pic X(10) value ' v08.03.13'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* KSDBIGC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           05  C3 pic X(28) value '   SimoTime Technologies    '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* KSDBIGC1 '.
           05  C2 pic X(32) value 'Thank you for using this program'.
           05  C3 pic X(32) value ' provided from SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* KSDBIGC1 '.
           05  C2 pic X(32) value 'Please send all inquires or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

       01  VKSD0256-STATUS.
           05  VKSD0256-STAT1      pic X.
           05  VKSD0256-STAT2      pic X.

       01  QSAM0080-STATUS.
           05  QSAM0080-STAT1      pic X.
           05  QSAM0080-STAT2      pic X.

       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  TWO-BYTES.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.
       01  TWO-BYTES-BINARY        redefines TWO-BYTES pic 9(4) comp.

       01  END-OF-FILE             pic X(3)    value 'NO '.

       01  CONSOLE-BUFFER.
           05  CONSOLE-HEADER      pic X(11)   value '* KSDBIGC1 '.
           05  CONSOLE-MESSAGE     pic X(68).

       01  VSAM-WRITE-ONLY         pic X       value 'N'.

       01  APPL-RESULT             pic S9(9)   comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  TEST-DATA.
           05  LOWER-CASE pic X(26) value 'abcdefghijklmnopqrstuvwxyz'.
           05  UPPER-CASE pic X(26) value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
           05  ZERO-NINE  pic X(10) value '0123456789'.

       01  SHIFT-COUNT    pic 9(3)  value 1.

       01  WORK-DATE.
           05  WORK-DATE-08        pic X(8).
       01  WORK-TIME               pic X(8).
       01  MESSAGE-LENGTH          pic 9(5)    value 1024.

       01  LOG-DATE                pic X(10)   value 'yyyy/nn/nn'.
       01  LOG-TIME                pic X(11)   value 'nn:nn:nn:nn'.

       01  START-TIME-MESSAGE.
           05  FILLER          pic X(19) value 'Start Time is..... '.
           05  START-DATE      pic X(10) value SPACES.
           05  FILLER          pic X(3)  value ' - '.
           05  START-TIME      pic X(11) value SPACES.

       01  STOP-TIME-MESSAGE.
           05  FILLER          pic X(19) value 'Stop Time is...... '.
           05  STOP-DATE       pic X(10) value SPACES.
           05  FILLER          pic X(3)  value ' - '.
           05  STOP-TIME       pic X(11) value SPACES.

       01  RECORD-COUNT-MESSAGE.
           05  FILLER          pic X(19) Value 'Record count is... '.
           05  RECORD-COUNT        PIC 9(12)   value 0.

       01 RECORD-LIMIT-MESSAGE.
           05  FILLER          pic X(19) Value 'Record limit is... '.
           05  RECORD-LIMIT        PIC 9(12)   value 0.

       01  RA12-REQUEST    PIC X(8).
       01  RA12-RESPOND    PIC 9(4).
       01  RA12-BUFFER.
           05  RA12-NUMBER PIC 9(12).
       01  Z-X12                   pic 9(3)    value 0.

      *01  RECORD-LIMIT            PIC 9(12)   value 1000.
      *01  RECORD-LIMIT            PIC 9(12)   value 50000.
      *01  RECORD-LIMIT            PIC 9(12)   value 250000.
      *01  RECORD-LIMIT            PIC 9(12)   value 1000000.
      *01  RECORD-LIMIT            PIC 9(12)   value 5000000.
      *01  RECORD-LIMIT            PIC 9(12)   value 13500000.
      *01  RECORD-LIMIT            PIC 9(12)   value 15000000.

      *****************************************************************
       LINKAGE SECTION.
       01  PARM-BUFFER.
           05  PARM-LENGTH         pic S9(4)   comp.
           05  PARM-DATA           pic X(128).

      *****************************************************************
       PROCEDURE DIVISION using PARM-BUFFER.

           perform Z-POST-COPYRIGHT.

           if  PARM-LENGTH > 0
           and PARM-LENGTH < 13
               move PARM-DATA(1:PARM-LENGTH) to CONSOLE-MESSAGE
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move PARM-DATA(1:PARM-LENGTH) to RA12-BUFFER
               perform RIGHT-ADJUST
               if  RA12-RESPOND = ZERO
                   add RA12-NUMBER to ZERO giving RECORD-LIMIT
               else
                   add 1000 to ZERO giving RECORD-LIMIT
               end-if
           end-if

           move RECORD-LIMIT-MESSAGE to CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE

           perform GET-DATE-AND-TIME
           move LOG-DATE to START-DATE
           move LOG-TIME to START-TIME
           move START-TIME-MESSAGE to CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE

           perform VKSD0256-OPEN.

           add 1 to ZERO giving RECORD-COUNT

           perform until RECORD-COUNT > RECORD-LIMIT
               add RECORD-COUNT to ZERO giving VKSD0256-KEY
      *
      *        * Clear the data area of the record to be written...
               move SPACES to VKSD0256-DATA
      *
      *        * Identify the record number
               move 'This is record - ' to VKSD0256-DATA
               move RECORD-COUNT to VKSD0256-DATA(18:12)
      *
      *        * Add the test data and shift one byte per each record
               if  SHIFT-COUNT = 1
                   move TEST-DATA to VKSD0256-DATA(32:62)
               else
                   move TEST-DATA(SHIFT-COUNT:63 - SHIFT-COUNT)
                     to VKSD0256-DATA(32:63 - SHIFT-COUNT)
                   move TEST-DATA(1:SHIFT-COUNT - 1)
                     to VKSD0256-DATA(95 - SHIFT-COUNT:SHIFT-COUNT - 1)
               end-if
               if  SHIFT-COUNT < 62
                   add 1 to SHIFT-COUNT
               else
                   add 1 to ZERO giving SHIFT-COUNT
               end-if
      *
      *        * Identify the end of the record...
               move '...End'     to VKSD0256-DATA(239:6)
      *
      *        * Write the record
               perform VKSD0256-WRITE
               add 1 to RECORD-COUNT
           end-perform.

           subtract 1 from RECORD-COUNT

           perform GET-DATE-AND-TIME
           move LOG-DATE to STOP-DATE
           move LOG-TIME to STOP-TIME
           move STOP-TIME-MESSAGE to CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE

           move RECORD-COUNT-MESSAGE to  CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE

           move 'VKSD0256-HAS-BEEN-UPDATED' to CONSOLE-MESSAGE
           move VKSD0256-KEY to CONSOLE-MESSAGE(27:12)
           perform Z-DISPLAY-CONSOLE-MESSAGE

           perform VKSD0256-CLOSE.

           move 'NORMAL-END-OF-JOB...' to CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE

           perform Z-THANK-YOU.

           GOBACK.

      *****************************************************************
      * The following routines are in alphabetic sequence.            *
      *****************************************************************

      *****************************************************************
       GET-DATE-AND-TIME.
           accept WORK-DATE from DATE YYYYMMDD
           accept WORK-TIME from TIME

           move WORK-DATE(1:4) to LOG-DATE(1:4)
           move WORK-DATE(5:2) to LOG-DATE(6:2)
           move WORK-DATE(7:2) to LOG-DATE(9:2)

           move WORK-TIME(1:2) to LOG-TIME(1:2)
           move WORK-TIME(3:2) to LOG-TIME(4:2)
           move WORK-TIME(5:2) to LOG-TIME(7:2)
           move WORK-TIME(7:2) to LOG-TIME(10:2)

           exit.

      *****************************************************************
       RIGHT-ADJUST.
           perform until RA12-BUFFER(12:1) not = SPACE
               if  RA12-BUFFER(12:1) = SPACE
                   add 11 to ZERO giving Z-X12
                   perform 11 times
                     move RA12-BUFFER(Z-X12:1) to RA12-BUFFER
                     (Z-X12 + 1:1)
                     subtract 1 from Z-X12
                   end-perform
                   move ZERO to RA12-BUFFER(1:1)
               end-if
           end-perform
           if  RA12-BUFFER NUMERIC
               move ZERO to RA12-RESPOND
           else
               add 8 to ZERO giving RA12-RESPOND
           end-if
           exit.

      *****************************************************************
      * Routines to do a read by KEY of the KSDS, VSAM Data Set. If   *
      * the read is successful then the record may be updated else a  *
      * new record may be added.                                      *
      *****************************************************************
       VKSD0256-GET.
           read VKSD0256-FILE
           if  VKSD0256-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  VKSD0256-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'YES' to END-OF-FILE
               else
                   move 'VKSD0256-Record-NOT-Found.'
                     to CONSOLE-MESSAGE
                   perform Z-DISPLAY-CONSOLE-MESSAGE
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       VKSD0256-WRITE.
           write VKSD0256-RECORD
           if  VKSD0256-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  VKSD0256-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'YES' to END-OF-FILE
               else
                   move 'VKSD0256-FAILURE-WRITE...' to CONSOLE-MESSAGE
                   move VKSD0256-STATUS to IO-STATUS
                   perform Z-DISPLAY-CONSOLE-MESSAGE
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       VKSD0256-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT VKSD0256-FILE
           if  VKSD0256-STATUS = '35'
               move 'Y' to VSAM-WRITE-ONLY
               move 'VKSD0256-FAILURE-OPEN-IO...' to CONSOLE-MESSAGE
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move VKSD0256-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               move 'VKSD0256-ATTEMPT-OPEN-OUTPUT..' to CONSOLE-MESSAGE
               perform Z-DISPLAY-CONSOLE-MESSAGE
               open output VKSD0256-FILE
           end-if
           if  VKSD0256-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'VKSD0256-FAILURE-OPEN...' to CONSOLE-MESSAGE
               move VKSD0256-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       VKSD0256-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close VKSD0256-FILE
           if  VKSD0256-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'VKSD0256-FAILURE-CLOSE...' to   CONSOLE-MESSAGE
               move VKSD0256-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  CONSOLE-MESSAGE not = SPACES
               perform Z-DISPLAY-CONSOLE-MESSAGE
           end-if
           move RECORD-COUNT-MESSAGE to  CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE
           move 'PROGRAM-IS-ABENDING...'  to CONSOLE-MESSAGE
           perform Z-DISPLAY-CONSOLE-MESSAGE
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * two digits if the full two byte file status is numeric. If    *
      * second byte is non-numeric then it will be treated as a       *
      * binary number.                                                *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               display '* KSDBIGC1 FILE-STATUS-' IO-STAT1 '/'
                       TWO-BYTES-BINARY upon console
           else
               display '* KSDBIGC1 FILE-STATUS-' IO-STATUS upon console
           end-if
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-CONSOLE-MESSAGE.
           display CONSOLE-Buffer upon console
           move all SPACES to CONSOLE-MESSAGE
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE     upon console
           display SIM-COPYRIGHT upon console
           exit.

      *****************************************************************
       Z-THANK-YOU.
           display SIM-THANKS-01 upon console
           display SIM-THANKS-02 upon console
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

Table of Contents Previous Section Next Section Summary

This is an example of how Micro Focus COBOL can create and access large indexed files on a Windows platform. 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 the JCL Connection for more examples of JCL functionality with programming techniques and sample code.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore How to Calculate Elapsed Processing Times that will be used as a baseline reference when processing small, medium and large data files. This test case is intended for the Micro Focus Server environment and requires the SIMOTIME Library to be installed.

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
Processing Large Files, Micro Focus and Windows
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com