Skip to main content

When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

documentation.microfocus.com/.../index.jsp

Hi Sawalter, the File Handler trace tool might give you what you need. It will record all the IO during execution and allows you to replay the IO without having to run the application again but you can also use it just to display the various IO operations that were performed using the file handler.

The trace tool is mainly used for internal purposes to help us diagnose file handling related problems.

Regards, Scot


When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

I have created a tracing config file, extfh.cfg. this file is put in c:\\data\\log_files\\trace\\, and is activated by a line in the batch file

SET EXTFH=%LOGDIR%\\trace\\extfh.cfg

It works similarly to the config file MFTRACE_CONFIG.

I am having a couple of issues, though. The trace file is created after running the batch script, and in the right directory, but I cannot start the trace player that is necessary to display the results of the trace. Following the directions in documentation.microfocus.com/.../index.jsp I still get errors. Command to open the trace player is >cobfhrepro2 /ntracefile. The main error is Cannot open trace file.


When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

I have created a tracing config file, extfh.cfg. this file is put in c:\\data\\log_files\\trace\\, and is activated by a line in the batch file

SET EXTFH=%LOGDIR%\\trace\\extfh.cfg

It works similarly to the config file MFTRACE_CONFIG.

I am having a couple of issues, though. The trace file is created after running the batch script, and in the right directory, but I cannot start the trace player that is necessary to display the results of the trace. Following the directions in documentation.microfocus.com/.../index.jsp I still get errors. Command to open the trace player is >cobfhrepro2 /ntracefile. The main error is Cannot open trace file.


When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

I have created a tracing config file, extfh.cfg. this file is put in c:\\data\\log_files\\trace\\, and is activated by a line in the batch file

SET EXTFH=%LOGDIR%\\trace\\extfh.cfg

It works similarly to the config file MFTRACE_CONFIG.

I am having a couple of issues, though. The trace file is created after running the batch script, and in the right directory, but I cannot start the trace player that is necessary to display the results of the trace. Following the directions in documentation.microfocus.com/.../index.jsp I still get errors. Command to open the trace player is >cobfhrepro2 /ntracefile. The main error is Cannot open trace file.


When running batch COBOL programs our mainframe provides counts of how many times each file is written, read, etc. This logging is helpful when debugging. Can Visual COBOL Runtime provide any similar logging?

Here's how it worked for me:

C:\\fh>type *.cbl

test.cbl

       select a-file assign "file.dat".

       fd a-file.

       01 a-rec pic x.

       move "x" to a-rec

       open output a-file

       write a-rec

       close a-file

C:\\fh>cobol test.cbl int() ;

Micro Focus COBOL

Version 2.2.00244 Copyright (C) Micro Focus 1984-2013. All rights reserved.

* Checking complete with no errors - starting code generation

* Generating test

* Data:         984     Code:         768     Literals:         408

C:\\fh>run test.int

C:\\fh>cobfhrepro3  /d

Session is 0000000000

I/O     Sess  Op  Opcode   Act   Exp   Filename                       O

Number    Id  Code Desc     Stat  Stat                                 K

-------- ---- ---- -------- ----- ----- ------------------------------ -

00000001 0001 FA01 Open      /    0/0   file.dat

00000002 0001 FAF3 Write     /    0/0   file.dat

00000003 0001 FA80 Close     /    0/0   file.dat

Session 000 finished

C:\\fh>type extfh.cfg

[file.dat]

trace=on

C:\\fh>