[Info-vax] Calling $CREPRC in COBOL

Richard Maher maher_rjSPAMLESS at hotmail.com
Fri Jun 10 21:05:20 EDT 2022


On 11/06/2022 1:39 am, VAXman- at SendSpamHere.ORG wrote:
>    10  ENQ-TYPE      PIC X(1)  VALUE EXTERNAL PQL$_ENQLM.
> ..............^
> %COBOL-E-EXTREFVAL, VALUE EXTERNAL clause ignored - valid only on COMP
> data-item
> 
> How do you put PQL$ items in to a COBOL "byte"?
> 

Unfortunately COBOL has never supported by integers but there are 
several ways to do it. (I haven't fired up my VMS machines in 5 years 
otherwise I'd give you an example. Back in the day when google groups 
could search the archives you could find one of several $creprc examples 
with all parameters including TCB)

Cumbersome: -

01 enqlm_word pic 9(4) comp value external pql$_enqlm.
01 enqlm_byte redefines enqlm_word.
    03  pql_enqlm pic x.

move pql_enqlm to somewhere.

Lose external symbols and hard code: -

Hexadecimal literals:

10  ENQ-TYPE      PIC X(1)  VALUE x"00".

Special Names:

SPECIAL-NAMES.
     PQL$_ENQLM value is 44. (I don't know the value)

10  ENQ-TYPE      PIC X(1)  VALUE PQL$_ENQLM.

The way I do it: -

Define a global .PSECT in the same .MAR file that you already probably 
do for $pqldef GLOBAL

Just lay it out as you would for macro.

.psect fred long, gbl,shr,wrt,blah

.byte pql$_enqlm

Then declare an EXTERNAL variable as the same name as your global psect.

01 fred external.
    03 pql$_enqlm pic x. (doesn't have to be same name)
    03 pic x.

* The last byte is NECESSARY to round up the psect size on Alpha, and
* Itanium. Macro does this automatically.

Again many examples in cov over the years



More information about the Info-vax mailing list