Highlighted
Contributor.
Contributor.
384 views

cobfhrepro3 File name display

Jump to solution

I'm using the mFFH cobol facility to create a file trace in a managed cobol program.  It's working file, but when I run cobfhrepro3 to produce a report of the trace, the file name on the report is only 30 bytes.  I'm using a fully-qualified UNC path as the file name, and it's way more than 30 bytes.

Is there a way to tell the trace facility or cobfhrepro3 to display more than 30 bytes of the file name?

Just a bit of background...the program I'm tracing wasn't written by me, and was written in native cobol.  I converted it to managed cobol so we could use it in a WCF service.  After about 500 runs, the service crashed in the Micro Focus file handler.  I'm guessing that there is a file that is not being closed, so the system is running out of file handles.  Since the program uses a lot of files, I'm using the trace facility to try to match opens and closes.

Any help would be much appreciated.

Thanks!

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Contributor.
Contributor.
I discovered that using cobfhrepro3 /j will remove the path and just show the file name. That was sufficient for my needs.

The /j parm is defines as "junk paths". My original thought was, "what the heck is a junk path?" Apparently, the designer of this utility meant "junk" to mean "remove.

Having noted all of that, your suggestion of using RunUnits is an excellent one, and one that I hadn't thought of. I'll be reviewing the examples of using RunUnit that you indicate.

Thanks, Chris!

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert
What product version are you using?

My next question would be are you using a RunUnit to control the calling of your COBOL programs from within the WCF service?

If you are creating a RunUnit upon entry to the service and then calling the programs through the RunUnit then you should be able to clean up the resources including file handles by invoking the RunUnit.StopRun method.

There is an example in the Samples Browser of using RunUnits with WCF, search for Run Units in the left-hand window and WCF Airport Demo on the right-hand side.

If you do need to trace the file I-O operations, cobfhrepro3 seems to be limited to displaying just the first 30 characters of the filename in the displayed output. I do not see an option to change this behavior.

I would recommend that you use a CTF trace to create a log file of all file handler operations instead as this will contain the full file name for both file open and close operations.

If you set the environment variable MFTRACE_CONFIG to point to the following config file then the file handler will be traced.

SET MFTRACE_CONFIG=c:\mytrace\myctf.cfg

Create c:\mytrace\myctf.cfg containing the following: (this can have any name in any accessible location)

mftrace.level=debug
mftrace.dest=TEXTFILE
mftrace.emitter.TEXTFILE#location=.\
mftrace.comp.mf.mffh.xfh#all=true
0 Likes
Highlighted
Contributor.
Contributor.
I discovered that using cobfhrepro3 /j will remove the path and just show the file name. That was sufficient for my needs.

The /j parm is defines as "junk paths". My original thought was, "what the heck is a junk path?" Apparently, the designer of this utility meant "junk" to mean "remove.

Having noted all of that, your suggestion of using RunUnits is an excellent one, and one that I hadn't thought of. I'll be reviewing the examples of using RunUnit that you indicate.

Thanks, Chris!

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.