I have a Visual COBOL project that uses DB Connectors. In my project, my programs ALSO read and write to files that are NOT in my SQL database.
My question is where or how do I setup the path so the programs and find those files?
In RM/COBOL we have the RMPATH, is there something like that with Visual COBOL?
You need to exclude these files from XFD generation if you wish to have them still be used as indexed files in your programs.
You can do this by surrounding them with an IDXFORMAT or FILETYPE directive.
Example:
$SET CREATEXFD
$SET IDXFORMAT"18" *>SQL Server file
select db-file1 assign to "mydb"
organization is indexed
access is dynamic
key is key-1.
$SET IDXFORMAT"0" *> default MF ISAM file
select if-file1 assign to "myif"
organization is indexed
access is dynamic
key is key-2.
$SET IDXFORMAT"18" *>SQL Server file
select db-file2 assign to "mydb2"
organization is indexed
access is dynamic
key is key-3.
The directive is in effect until it encounters another directive which will change the default.
You can also set this in an extfh.cfg file:
See the docs here:
You need to exclude these files from XFD generation if you wish to have them still be used as indexed files in your programs.
You can do this by surrounding them with an IDXFORMAT or FILETYPE directive.
Example:
$SET CREATEXFD
$SET IDXFORMAT"18" *>SQL Server file
select db-file1 assign to "mydb"
organization is indexed
access is dynamic
key is key-1.
$SET IDXFORMAT"0" *> default MF ISAM file
select if-file1 assign to "myif"
organization is indexed
access is dynamic
key is key-2.
$SET IDXFORMAT"18" *>SQL Server file
select db-file2 assign to "mydb2"
organization is indexed
access is dynamic
key is key-3.
The directive is in effect until it encounters another directive which will change the default.
You can also set this in an extfh.cfg file:
See the docs here:
NO, that is not what I'm saying.
I have files IN ADDITION to my SQL DB that I need to read as INPUT into my programs, or OUTPUT so a 3rd party can use a file.
I need to know how to tell my COBOL programs where to look to find/write the files.
In RM/COBOL we have the RMPATH, is there something like that with Visual COBOL?
NO, that is not what I'm saying.
I have files IN ADDITION to my SQL DB that I need to read as INPUT into my programs, or OUTPUT so a 3rd party can use a file.
I need to know how to tell my COBOL programs where to look to find/write the files.
In RM/COBOL we have the RMPATH, is there something like that with Visual COBOL?
I think that COBDATA is what you are looking for.
See the docs here:
I have a Visual COBOL project that uses DB Connectors. In my project, my programs ALSO read and write to files that are NOT in my SQL database.
My question is where or how do I setup the path so the programs and find those files?
In RM/COBOL we have the RMPATH, is there something like that with Visual COBOL?
Do you use in this way Mysql as database?
i connect correctly as mssql and use only SQL commands!
the db-database and files are found automaticaly with the connect over ip or Name, i use here a connectstring
Example: admfirm.ini with following lines:
[SQL-Server]
ConnectString=Driver=SQL Server;server=192.168.13.63;database=admfirm;uid=adm;pwd=adm;
i read this file first and then make the connect, so i am very dynamic
For the isam-file (non db-files) i use a filename holder
01 fileholder1 pic x(255).
01 path1 pic x(255).
01 filename1 pic x(255).
then i use one cfg-file for a application and read here the path and string path and filename
adm.cfg
ADMDAT=I:\\ADM\\ADMFIRM\\DATEN\\
ADMPRT=I:\\ADM\\ADMFIRM\\DATEN\\PRT\\
ADMPRG=I:\\ADM\\ADMFIRM\\PROG\\
etc.....
i read this file and string the correct path and filename, example moving Content after ADMDAT in variable path1
move ' ' to fileholder1
string path1 delimited by ' '
filename1 delimited by ' '
into fileholder1
end-string
SELECT FILENAME ASSIGN TO FILEHOLDER1
i hope this help you and you can enjoy, so you can work simply with your applications!
When you have better solution, i will also enjoy and i am ready to learn more!!!