Remapping a file name hard-coded in a SELECT statement using an external variable.


If your program uses a hard-coded value for the data file name, you can define an alternate name as an alias in your configuration file.  To do this, add the following two properties to your configuration file:

iscobol.file.env_naming=true
iscobol.<assign_to_name>=<new-name>

Important: The name must be normalized:

Suppose your program includes the following SELECT statement:

 

       select FILE1 assign to "file-1"
           organization indexed
           access dynamic
           record key f1-key
           status file-status
           .
To use an alternate file name, such as new-file-1, add these properties to your configuration file:

 

iscobol.file.env_naming=true
iscobol.file_1=new-file-1

If the "assign to" contains a full or a relative path name, the path needs to be specified in your property.

For example:  

       select FILE1 assign to "subdir/file-1"
           organization indexed
           access dynamic
           record key f1-key
           status file-status
           .
iscobol.file.env_naming=true
iscobol.subdir/file_1=subdir/new-file-1


Article ID: 273
Created: May 30, 2016
Last Updated: January 5, 2026
Author: Support KB Author

Online URL: https://support.veryant.com/phpkb/article.php?id=273