Operating System - OpenVMS
1751902 Members
5045 Online
108783 Solutions
New Discussion юеВ

Re: ANALYZE/IMAGE callable interface?

 
SOLVED
Go to solution
Kay Dolle
Advisor

Re: ANALYZE/IMAGE callable interface?

I fixed the last problem with
name PIC S9(6) comp value is external name
Also the compiler accepts that with a "comp"-Variable - means integer...
Anyone an idea for a string?
Kris Clippeleyr
Honored Contributor

Re: ANALYZE/IMAGE callable interface?

Kay,

> Anyone an idea for a string?

I haven't got an example in COBOL, but I have used the technique described by Hoff for years from C.
In the .OPT file, e.g.

SYMBOL=QVER,%x332E3056

The hex-value, converted to ASCII and read from right to left is "V0.3"

In my C code, I declare a global value:

globalvalue int QVER;

Then, I declare a descriptor like this:

int vers = QVER;
struct dsc$descriptor_s dsc = {
(unsigned short int) sizeof ( int )
, (unsigned char) DSC$K_DTYPE_T
, (unsigned char) DSC$K_CLASS_S
, (char *) &vers
}

This descriptor I then use in a call to lib$put_output:

int sts;
sts = lib$put_output ( &dsc );

Hope this helps,
Kris (aka Qkcl)

I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Kay Dolle
Advisor

Re: ANALYZE/IMAGE callable interface?

I have found the way we don't need the string. Our version numbers are like "Vn.nn" with no Caracters behind "V". So it is only the definition of a structure and one "move" in COBOL to retreive the desired format.

Thanks for all for help!
best regards,
Kay
Hoff
Honored Contributor

Re: ANALYZE/IMAGE callable interface?

I've always used integers, since it's easier to use same for comparisons than a text string, and it's easier to construct a text string than to parse it.

For cases where I needed a text string (such as for cases of human display), I stuff the same values into a standard print statement enveloped with the appropriate prettiness.
Kay Dolle
Advisor

Re: ANALYZE/IMAGE callable interface?

Thanks again to all!
We'll use the solution with the gloabl symbols in the opt-file. It is easy to use, portable and adaptable with less effort.
Best regards,
Kay Dolle