Highlighted
Frequent Contributor.
Frequent Contributor.
241 views

Is there a cobfile for Visual Cobol?

Jump to solution

In Server Express you have the command cobfile that you can use to identify how a gnt file was built, i.e.

$ cobfile k9initora.gnt
k9initora.gnt: Micro Focus 64-bit generated code file for Intel x86 (Win64)

$ cobfile k9initora.gnt
k9initora.gnt: Micro Focus 64-bit generated code file for HP/UX IA64

My question is simple, with Visual Cobol is there some tool that can do this? 

/Robert

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Is there a cobfile for Visual Cobol?

Jump to solution

cobfile is available only in the Linux/Unix versions of Visual COBOL which would be the DevHub product.

The version you have installed is the Windows version and that does not provide that tool.

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Is there a cobfile for Visual Cobol?

Jump to solution

Hi.

The same "cobfile" tool is found in Visual COBOL.

    $COBDIR/bin/cobfile

0 Likes
Frequent Contributor.
Frequent Contributor.

Re: Is there a cobfile for Visual Cobol?

Jump to solution

Hm, that's weird I don't seem to have it. As far as I know it's a standard install of VC.

C:\Program Files (x86)\Micro Focus\Visual COBOL\bin>echo %COBDIR%
C:\Program Files (x86)\Micro Focus\Visual COBOL\;

C:\Program Files (x86)\Micro Focus\Visual COBOL\bin>dir cobfile*
Volume in drive C is Lokal disk
Volume Serial Number is B02F-BBE0

Directory of C:\Program Files (x86)\Micro Focus\Visual COBOL\bin

File Not Found

On another note. Don't know why there's a ";" in my COBDIR but it's not something I've fiddled with.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Is there a cobfile for Visual Cobol?

Jump to solution

cobfile is available only in the Linux/Unix versions of Visual COBOL which would be the DevHub product.

The version you have installed is the Windows version and that does not provide that tool.

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Is there a cobfile for Visual Cobol?

Jump to solution

Some background:

The "cobfile" tools is a wrapper around the standard Linux/Unix "file" utility.

The standard "file" utility can consume a custom "magic" file which is used to identify the file and we provide a custom magic file in $COBDIR/etc/cobmagic with product specific identifiers.

So,  in order to provide the same feature on Microsoft or Micro Focus would also need to provide a "file" command that can process this customer magic file.

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: Is there a cobfile for Visual Cobol?

Jump to solution

OK then, WSL on Win 10 to the rescue. Move the cobmagic file to your devbox, write a script named cobfile that does the following (haven't bothered about that warning message yet):

$ cd /mnt/c/temp
$ file -m /mnt/c/usr/local/etc/cobmagic d9initora.gnt
/mnt/c/usr/local/etc/cobmagic, 35: Warning: description `not succ Micro Focus 32-bit intermediate code file (incomplete/' truncated
d9initora.gnt: Micro Focus 64-bit generated code file
$ file -m /mnt/c/usr/local/etc/cobmagic d9dberror.gnt
/mnt/c/usr/local/etc/cobmagic, 35: Warning: description `not succ Micro Focus 32-bit intermediate code file (incomplete/' truncated
d9dberror.gnt: Micro Focus Server Express 32-bit generated code file

 

/robert

 

#! /bin/bash

# cobfile

#

test $# -gt 0 || exit 1

file -m /mnt/c/usr/local/etc/cobmagic $*

exit

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.