How to create, write, and read to files without a program

Question ID : 334
Created on 2022-11-07 at 8:21 AM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=334



Question:

Does isCOBOL provide a method to create an indexed file with a given structure and name, read a file by key and return the record value, and write records into a file?

Answer:

Yes, by using jutil, ctutil, and Gife utilities

  1. To create indexed files with a given structure and name.
    1. If you are using the JISAM file handler, use the jutil utility to create a new empty file by passing an image string (-jutil -makeimage), or by interacting with the utility to provide the image information (jutil -gen)
      You can also extract records from an indexed file to a text file, and load them to the new file using jutil -unload, unloadtext, -load and -loadtext
    2. If you are using c-treeRTG, use the ctutil utility. This utility has the same features of jutil, but works on the ctree file system.
  2. To read a file by key and review, edit or write records.
    Use the GIFE utility. This utility will open an indexed or relative file using any file handler.
    You can view and edit the data in raw format (each record as one string), or as values of the file description if you have an extended file description (created with the -efd compile switch).
  3. Read, edit and write records without knowing the data fields.
    isCOBOL also provides the I$IO library routine to give low-level access to indexed files without the need of an FD or Select.
    For more information about how to use this, please read the section on I$IO in our Appendices documentation.
    You can also see I$IO used in a sample program called "IIO.cbl" in our sample directory, under the "issamples" section.



Back to Original Question