Skip to main content

I currently have the extfh.cfg file handler in the same folder/directory where my Visual COBOL application resides. However, the data files that the extfh.cfg is handling are located on a different folder. My extfh.cfg looks like this:

 

[XFH-DEFAULT]

IDXFORMAT=3

[file1.dat]

IDXFORMAT=8

FILEMAXSIZE=8

[file2.dat]

IDXFORMAT=8

FILEMAXSIZE=8

 

Since the data files are located in another folder, do I have to specify the path where the data files are located in the extfh.cgf file? For example, does the configuration have look like this:

 

[c:\\files\\XFH-DEFAULT]

IDXFORMAT=3

[c:\\files\\file1.dat]

IDXFORMAT=8

FILEMAXSIZE=8

[c:\\files\\file2.dat]

IDXFORMAT=8

FILEMAXSIZE=8

Thanks in advance. 

I currently have the extfh.cfg file handler in the same folder/directory where my Visual COBOL application resides. However, the data files that the extfh.cfg is handling are located on a different folder. My extfh.cfg looks like this:

 

[XFH-DEFAULT]

IDXFORMAT=3

[file1.dat]

IDXFORMAT=8

FILEMAXSIZE=8

[file2.dat]

IDXFORMAT=8

FILEMAXSIZE=8

 

Since the data files are located in another folder, do I have to specify the path where the data files are located in the extfh.cgf file? For example, does the configuration have look like this:

 

[c:\\files\\XFH-DEFAULT]

IDXFORMAT=3

[c:\\files\\file1.dat]

IDXFORMAT=8

FILEMAXSIZE=8

[c:\\files\\file2.dat]

IDXFORMAT=8

FILEMAXSIZE=8

Thanks in advance. 

The default is that you would need to specify a full path but this can be changed by adding the BASENAME=ON option to the XFH-DEFAULT header.

[XFH-DEFAULT]
BASENAME=ON
[testfile.dat]
STRIPSPACE=OFF

If you have in your program something like:

select my-file assign to "C:\\mydata\\testfile.dat"

then with BASENAME=ON set the file handler will find the file without specifying the full path in the config file.

There are other options that you can use including the FOLDERS option to set configuration options for an entire folder or INTERNAL which allows an alternative mapping if you are using ASSIGN DYNAMIC or ASSIGN EXTERNAL in your program.

BTW, when specifying a path name in the config file you must double the slashes, 

[c:\\\\mydata\\\\testfile.dat]

This is all covered in the documentation here.


The default is that you would need to specify a full path but this can be changed by adding the BASENAME=ON option to the XFH-DEFAULT header.

[XFH-DEFAULT]
BASENAME=ON
[testfile.dat]
STRIPSPACE=OFF

If you have in your program something like:

select my-file assign to "C:\\mydata\\testfile.dat"

then with BASENAME=ON set the file handler will find the file without specifying the full path in the config file.

There are other options that you can use including the FOLDERS option to set configuration options for an entire folder or INTERNAL which allows an alternative mapping if you are using ASSIGN DYNAMIC or ASSIGN EXTERNAL in your program.

BTW, when specifying a path name in the config file you must double the slashes, 

[c:\\\\mydata\\\\testfile.dat]

This is all covered in the documentation here.

Thank you for that information!