[Info-vax] Calling $CREPRC in COBOL

Arne Vajhøj arne at vajhoej.dk
Fri Jun 10 20:49:36 EDT 2022


On 6/10/2022 3:57 PM, Bill Gunshannon wrote:
> On 6/10/22 15:03, Craig A. Berry wrote:
>>
>> On 6/10/22 1:27 PM, Bill Gunshannon wrote:
>>> On 6/10/22 14:16, Craig A. Berry wrote:
>>>> On 6/10/22 12:39 PM, 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"?
>>>>
>>>> I never knew much COBOL and haven't looked at any in decades, but I
>>>> would think for a one-byte integer it would be "PIC 9(1)" rather than
>>>> "PIC X(1)".
>>>
>>> PIC X(1) would be more likely to be a byte than PIC 9(1) as
>>> PIC 9(1) is one decimal digit and PIC X(1) is one character.
>>>
>>> But neither is correct.
>>
>> So, since you frequently brag about your COBOL prowess here, why not
>> give the correct answer?
> 
> I haven't touched VMS COBOL in 2 decades since they threw both COBOL
> and VMS out the door at the University of Scranton.  But, in any event
> I have no idea what POL$_ENOLM means or what he is trying to do with it.
> A rough guess would be rather than declaring it external he needs to
> use some VMS Specific function to grab the value and load it into
> ENO-TYPE.

PQL$_ENQLM is a VMS constant.

The external keyword tells the program to get the value
from the linker.

Demo:

$ type ext.cob
identification division.
program-id.ext.
*
data division.
working-storage section.
01 magic pic s9(9) comp value external extval.
01 showit pic 9(9) display.
*
procedure division.
main-paragraph.
     move magic to showit
     display showit
     stop run.
$ type extsup.c
globalvalue int extval = 123;
$ cob ext
$ cc extsup
$ link ext + extsup
$ run ext
000000123

Arne





More information about the Info-vax mailing list