support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets

Veryant Knowledge Base
Home > All Categories > Data Access > Did you know you can encrypt an indexed file?
Question Title Did you know you can encrypt an indexed file?

With isCOBOL it's possible to encrypt an indexed file.
Encryption of indexed files is supported by the following file systems:


It's possible to mix encrypted file with non encrypted files, as needed.
Below you can find the instructions to activate encryption for each file system.


To activate encryption on a file when using JISAM, you need to add the "with encryption" clause to the SELECT statement of the file, after the "organization" clause.
For example change the select statement from

       select FILE1 assign to "IndexedFile"
           organization indexed
           access dynamic
           record key f1-key
           status file-status
       select FILE1 assign to "IndexedFile"
           organization indexed
           access dynamic
           record key f1-key
           status file-status
You then need to specify the encryption key by adding the following configuration property

The configuration property must be set to a value different from spaces, otherwise a file mismatch error is raised. The encryption key can be up to 16 characters long. The Blowfish algorithm is used to encrypt data. If an encrypted file is opened for input or i-o with the wrong encryption key, then a file corrupt error is raised. If the encryption key is not set in the configuration, opening an encrypted file produces a 9X status.
To encrypt an existing file, the file must be converted. The simplest way to encrypt a file is using the ISMIGRATE utility.

Select JISAM for "From" and "To" file system

Press Next
Select the file to encrypt

And press next

Select the destination folder and make sure the "Enable encryption" check-box is set and specify the encryption key, which must be the same value in the configuration property iscobol.file.encryption.key. Follow the wizard steps.
Now you have the encrypted version of the file.
When using utilities that access an encrypted indexed file, the encryption key must be passed either in the command line, where supported, or in the configuration file.


C-ctree can handle encryption without any code change, but just needs configuration changes.
iscobol configuration file or ctree-conf configuration file can be used to control encryption settings.
The isCOBOL configuration is only used by cobol programs or isCOBOL utilities, while the ctree-conf configuration file is used by isCOBOL programs and the c-tree utilities.

isCOBOL configuration

Use the following configuration properties to configure encryption:

With this property every file is encrypted.
To encrypt only the selected file, an instance of c-tree must be created by adding the following property
The value must reflect the number of instances created by c-tree. In this case it is 2 because there is the default instance (instance 0) and the encrypted instance (instance 1).
Is the definition of instance 1 (encrypted instance), the server can be the same as the default instance. The settings of instance 0 (default instance) is omitted in this sample since the defaults are used.
Is the list of the file included into the instance 1. Multiple names must be separated by commas. Wildcards are supported. The files not included in this list will use instance 0
Activate encryption on instance 1

C-tree conf

In your configuration file add the following configuration property
and configure the ctree.conf file as below to encrypt all files
   <instance server="FAIRCOMS@" connect="no">
Or use the configuration below to encrypt a single file
   <instance server="FAIRCOMS@" connect="no">
      <file name="IndexedFile1">
To encrypt an existing file, the file must be converted.
The simplest way to encrypt a file is using the command line version of the ISMIGRATE utility.
First create a specific configuration file with the following properties
and use the following command line statements
iscmigrate c:/encryption/test/IndexFile1 c:/encryption/test/encrypted/IndexFile1
Authored by: Veryant Support This question has been viewed 3528 times so far.
Click Here to View all the questions in Data Access category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. File Types Comparison : isCOBOL - Micro Focus COBOL - ACUCOBOL-GT - RM/COBOL
  2. How do I interpret file status 9? and other EXFS extended file status codes (e.g. 9i,105)?
  3. What format does isCOBOL use for ORGANIZATION RELATIVE files?
  4. What is 9l,10 error and why is it happening?
  5. Does isCOBOL support Data General file status codes?
  6. Can we use Micro Focus data format and indexed files directly or do they need some type of conversion?
  7. Can I install the UDBC 32 bit on my 64 bit computer in order to have the Veryant * driver for ODBC32 bits Administrator?
  8. Can I call from an isCobol program a stored procedure?
  9. Why do I get the error message “java.lang.ClassNotFoundException: ctree2" ?
  10. Why do I get 'ct_init ERROR 19:133:0' ?
  11. Did you know you can use an alias to map a different disk file name to an existing &quot;assign to&quot; clause of the select statement without source code changes?
  12. Handling the extension on indexed data files
  13. How to hide the user and password used to connect to an RDBMS
  14. Can we use Micro Focus format data and indexed files directly or do they need some form of conversion?
Article Information Additional Information
Article Number: 291
Created: 2018-04-17 2:54 AM
Rating: No Rating
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
Search Knowledge Base Search Knowledge Base


© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.