       identification division.
      *----------------------------------------------------------------*
      * dfhrdtux.cbl
      *----------------------------------------------------------------*
      * Copyright (C) 1998-2006 Micro Focus (IP) Limited. 
      * All rights reserved.
      *  
      * This demonstration program is provided for use by users of 
      * Micro Focus products (the "Software") and may be used,
      * modified and distributed as part of your application provided 
      * that you properly acknowledge the copyright of Micro Focus in this
      * material.
      *     
      * All conditions, warranties and undertakings, express or implied, 
      * statutory or otherwise, on the part of Micro Focus are excluded,
      * including without limitation those of merchantability or fitness  
      * for purpose. This shall not, however, purport to exclude or 
      * restrict the liability of Micro Focus to any extent not
      * permitted by law.
      *
      * IN NO EVENT WILL MICRO FOCUS BE LIABLE FOR ANY INDIRECT,
      * INCIDENTAL, SPECIAL, CONSEQUENTIAL OR OTHER DAMAGES ARISING OUT 
      * OF THE USE OF THE DEMONSTRATION PROGRAM DISTRIBUTED WITH THE 
      * SOFTWARE, WHETHER OR NOT INFORMED OF THE POSSIBILITIES OF 
      * DAMAGES IN ADVANCE.  THESE LIMITATIONS APPLY TO ALL CAUSES OF 
      * ACTION, INCLUDING BREACH OF CONTRACT, BREACH OF WARRANTY, STRICT
      * LIABILITY, AND ANY ACTIONS IN TORTS.
      *----------------------------------------------------------------*
      *
      *            This program is a sample exit called by the MCO
      *            resource definition table (RDT) utility, DFHRDTUP.
      *            Its purpose is to provide missing data for FCT
      *            entries.
      *
      *            On entry to this exit, the following fields are set:
      *
      *            File name: FCT ID of the file for which information
      *                       is required.
      *            Request flag: contains 1 to 6, and asks for:
      *             (1) Return file type:
      *                 "K" for KSDS
      *                 "E" for ESDS
      *                 "R" for RRDS
      *                 "A" for AltIndex
      *             (2) Return base file ID for AltIndex
      *             (3) Return KSDS/AltIndex key position
      *             (4) Return KSDS/AltIndex key length
      *             (5) Return minimum record length
      *             (6) Return maximum record length
      *
      *            On return from this exit, one of the following
      *            fields should be set:
      *
      *            Num - for request types 3 to 6.
      *            Char - for request types 1 and 2.
      *
      *            If any value is unknown, the Num return field may
      *            be set to -1. In this case, the information will be
      *            obtained from the user, unless "quiet" mode is
      *            active.
      *----------------------------------------------------------------*

       file-control.
       data division.
       file section.
       working-storage section.
       01 ws-current-record.
          03 ws-curr-file                    pic x(8) value spaces.
          03 ws-rec-found-flag               pic x comp-x value 0.
             88 ws-rec-found-88                           value 1
                                                          false 0.
       linkage section.
       copy 'dfhrdtux.cpy' replacing ==(data)== by ==ls==.
       procedure division
            using ls-rdtux-file
                  ls-rdtux-req-flag
                  ls-rdtux-return
            .
       program-entry section.
      *        Do we have the required file record?
           if ls-rdtux-file not = ws-curr-file
               perform get-file-information
           end-if
           if ws-rec-found-88
               continue
           else
               set ls-rdtux-unknown-val to true
               goback
           end-if
      *        What information are we being asked for?
           evaluate true
             when ls-rdtux-req-file-type
               perform return-file-type
             when ls-rdtux-req-base-file
               perform return-base-file
             when ls-rdtux-req-key-pos
               perform return-key-position
             when ls-rdtux-req-key-len
               perform return-key-length
             when ls-rdtux-req-min-lrecl
               perform return-min-lrecl
             when ls-rdtux-req-max-lrecl
               perform return-max-lrecl
             when other
               set ls-rdtux-unknown-val to true
           end-evaluate
           goback
           .

       get-file-information section.
           set ws-rec-found-88 to false
      * add code here to retrieve information about the file
           exit.
       return-file-type section.
      * add code here to set the file type: AltIndx, KSDS, RRDS, ESDS
      * eg move "K" to ls-rdtux-char
           set ls-rdtux-unknown-val to true
           exit.
       return-base-file section.
      * add code here to set the base file ID for an AltIndx
      * eg move base-file-id to ls-rdtux-char
           set ls-rdtux-unknown-val to true
           exit.
       return-key-position section.
      * add code here to set the key position for a KSDS
      * eg move key-pos to ls-rdtux-num
           set ls-rdtux-unknown-val to true
           exit.
       return-key-length section.
      * add code here to set the key length for a KSDS
      * eg move key-len to ls-rdtux-num
           set ls-rdtux-unknown-val to true
           exit.
       return-min-lrecl section.
      * add code here to set the minimum record length
      * eg move min-rec-len to ls-rdtux-num
           set ls-rdtux-unknown-val to true
           exit.
       return-max-lrecl section.
      * add code here to set the maximum record length
      * eg move max-rec-len to ls-rdtux-num
           set ls-rdtux-unknown-val to true
           exit.
