Cobol-81 on RSX11m+

43 views
Skip to first unread message

Andrew Barron

unread,
Dec 15, 2025, 4:43:10 PM (3 days ago) Dec 15
to [PiDP-11]
Hi, I am missing something basic. Every time I compile, I get one fatal error. Probably a missing line. This code worked on the COBOL-68 on TOPS-10 (PiDP10).   I tried compiling with the ANSI switch, but although it got rid of the warnings, the fatal error persists. I tried two other Cobol programs that worked on the PiDP10 and they both have the same problem. 

$ EDT CHELLO.CBL
*C
        IDENTIFICATION DIVISION.
        PROGRAM-ID. HELLO.
        ENVIRONMENT DIVISION.
        DATA DIVISION.
        PROCEDURE DIVISION.
               DISPLAY "HELLO WORLD!".
               STOP RUN.
[EOB]


$ COBOL/ANSI_FORMAT CHELLO.CBL
C81 - 1 FATAL ERRORS - object deleted
C81 - 0 WARNINGS
C81 - 0 INFORMATIONALS  

$ COBOL CHELLO.CBL
C81 - 1 FATAL ERRORS - object deleted
C81 - 0 WARNINGS
C81 - 4 INFORMATIONALS

cheers AndrewB

Johnny Billquist

unread,
Dec 15, 2025, 4:50:27 PM (3 days ago) Dec 15
to pid...@googlegroups.com
You should add /LIST, so you get a listing file for the compilation.
That will tell you what your problems are in more detail.

But basically (from doing that myself):

1 * C
2 IDENTIFICATION DIVISION.
^
*** I 292 Division, section and paragraph headers must begin in Area A.
3 PROGRAM-ID. HELLO.
^
*** I 292 Division, section and paragraph headers must begin in Area A.
4 ENVIRONMENT DIVISION.
^
*** I 292 Division, section and paragraph headers must begin in Area A.
5 DATA DIVISION.
^
*** I 292 Division, section and paragraph headers must begin in Area A.
6 PROCEDURE DIVISION.
7 DISPLAY "HELLO WORLD!".
^
*** F 590 A section header or paragraph-name is required.
8 STOP RUN.


I don't know enough Cobol to make much sense of this. :-)

Johnny
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/
> d1236f79-93ab-4fee-8335-e260dadf3275n%40googlegroups.com <https://
> groups.google.com/d/msgid/pidp-11/d1236f79-93ab-4fee-8335-
> e260dadf3275n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

Ken Hansen

unread,
Dec 15, 2025, 5:12:18 PM (3 days ago) Dec 15
to pid...@googlegroups.com
COBOL was originally input via so-called "Hollerith cards", and program text was to start on a particular column (7? 8?) the first several columns were for labels.

Apparently, COBOL-68 is playing fast-and-loose with that requirement, ANSI COBOL is stricter.

It's been 30 years since I touched COBOL, but that's what the first 4 errors are.

See https://www.ibmmainframer.com/cobol-tutorial/cobol-hello-world/
 
(They are discussing modern cobol, not 'classic' book-68)

Ken

On Dec 15, 2025, at 15:43, Andrew Barron <zl...@outlook.co.nz> wrote:

Hi, I am missing something basic. Every time I compile, I get one fatal error. Probably a missing line. This code worked on the COBOL-68 on TOPS-10 (PiDP10).   I tried compiling with the ANSI switch, but although it got rid of the warnings, the fatal error persists. I tried two other Cobol programs that worked on the PiDP10 and they both have the same problem. 
--
You received this message because you are subscribed to the Google Groups "[PiDP-11]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/d1236f79-93ab-4fee-8335-e260dadf3275n%40googlegroups.com.

Ken Hansen

unread,
Dec 15, 2025, 6:04:02 PM (3 days ago) Dec 15
to pid...@googlegroups.com
Also, looking at ibm mainframer example, single quotes vs double quotes?


Ken

On Dec 15, 2025, at 15:50, Johnny Billquist <b...@softjar.se> wrote:

You should add /LIST, so you get a listing file for the compilation. That will tell you what your problems are in more detail.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-11+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pidp-11/5ee1cfce-ea86-4403-8f05-3f52525406ef%40softjar.se.

Peter Long

unread,
Dec 15, 2025, 6:06:16 PM (3 days ago) Dec 15
to Ken Hansen, pid...@googlegroups.com
Double quotes works - the only other thing is that you need a MAIN-PARA. 

>type hello.c81
        IDENTIFICATION DIVISION.
        PROGRAM-ID. HELLO.
        ENVIRONMENT DIVISION.
        DATA DIVISION.
        PROCEDURE DIVISION.
        MAIN-PARA.
            DISPLAY "HELLO WORLD".
            STOP RUN.

>
>type hello.lst
HELLO                                                           16-DEC-2025  10:01:44   COBOL-81 V3.1-00                    PAGE   1
                                                                16-DEC-2025  10:01:27   DU:[PLONG]HELLO.C81;4

    1               IDENTIFICATION DIVISION.
    2               PROGRAM-ID. HELLO.
    3               ENVIRONMENT DIVISION.
    4               DATA DIVISION.
    5               PROCEDURE DIVISION.
    6               MAIN-PARA.
    7                   DISPLAY "HELLO WORLD".
    8                   STOP RUN.
    9





HELLO                                                           16-DEC-2025  10:01:44   COBOL-81 V3.1-00                    PAGE   2
                                                                16-DEC-2025  10:01:27   DU:[PLONG]HELLO.C81;4

DIAGNOSTICS

    No Errors


COMMAND SWITCHES

    HELLO,HELLO,=HELLO.C81/CVF

    /-CRF/-DEB/CVF/BOU/-MAP/PER/-CIS/INF/-SUB/SKL/-TRU/-BLD/-FIP/-CON/-FLG/-STA
>



From: pid...@googlegroups.com <pid...@googlegroups.com> on behalf of Ken Hansen <n2...@w5fc.org>
Sent: Tuesday, December 16, 2025 10:03
Cc: pid...@googlegroups.com <pid...@googlegroups.com>
Subject: Re: [PiDP-11] Cobol-81 on RSX11m+

Lawrence Kesteloot

unread,
Dec 15, 2025, 6:18:54 PM (3 days ago) Dec 15
to Peter Long, Ken Hansen, pid...@googlegroups.com
Oh I'm so excited about this! It's on my list to learn COBOL next year. I was going to use some compiler on macOS, but this thread makes me want to learn it on the PiDP-11 through my ADM-3A.

Lawrence


Johnny Billquist

unread,
Dec 15, 2025, 6:19:18 PM (3 days ago) Dec 15
to pid...@googlegroups.com
I guess the next question is how you link that thing. :-)
(I can figure that out if others can't...)

Johnny
> ------------------------------------------------------------------------
> *From:* pid...@googlegroups.com <pid...@googlegroups.com> on behalf of
> Ken Hansen <n2...@w5fc.org>
> *Sent:* Tuesday, December 16, 2025 10:03
> *Cc:* pid...@googlegroups.com <pid...@googlegroups.com>
> *Subject:* Re: [PiDP-11] Cobol-81 on RSX11m+
> pidp-11/059C7ED5-FD29-4B8C-A31D-ABA13A2B5FCA%40w5fc.org <https://
> groups.google.com/d/msgid/pidp-11/059C7ED5-FD29-4B8C-A31D-
> ABA13A2B5FCA%40w5fc.org?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/
> SYBPR01MB6938008B20166D0C7DB530F98BADA%40SYBPR01MB6938.ausprd01.prod.outlook.com <https://groups.google.com/d/msgid/pidp-11/SYBPR01MB6938008B20166D0C7DB530F98BADA%40SYBPR01MB6938.ausprd01.prod.outlook.com?utm_medium=email&utm_source=footer>.

Johnny Billquist

unread,
Dec 15, 2025, 6:37:57 PM (3 days ago) Dec 15
to pid...@googlegroups.com
To link, just add /C81 to the command line for linking, and you are all
good.

$ cob test7/ansi/list
$ link test7/c81


$ run test7
HELLO WORLD!

$


Johnny
>>     You should add /LIST, so you get a listingfile for the
>>         one fatal error. Probably amissing line. This code worked on
>>         the COBOL-68 on TOPS-10 (PiDP10).  I tried compiling with the
>>         ANSI switch, but although it got rid of the warnings, the fatal
>>         error persists. I tried twoother Cobol programs that worked on
>>     Johnny Billquist                  || "I'mon a bus

Peter Long

unread,
Dec 15, 2025, 6:38:28 PM (3 days ago) Dec 15
to Johnny Billquist, pid...@googlegroups.com
Lol - pretty much as you'd expect

>LINK HELLO,[1,1]C81LIB/LIB ...


Btw - thanks for auto-including the RTLs when you install C81 - one less thing ;-) 


Peter

From: pid...@googlegroups.com <pid...@googlegroups.com> on behalf of Johnny Billquist <b...@softjar.se>
Sent: Tuesday, 16 December 2025 10:19
To: pid...@googlegroups.com <pid...@googlegroups.com>
Subject: Re: [PiDP-11] Cobol-81 on RSX11m+
 

Johnny Billquist

unread,
Dec 15, 2025, 6:42:48 PM (3 days ago) Dec 15
to Peter Long, pid...@googlegroups.com
Yeah. That works. But DCL even have some more fancy bits for automating
cobol linking, as you can see in my mail.

Also, I suspect, depending on what you do in your program, other
libraries might be required as well.

And if you run C81 from MCR, there is also the /BLD switch, which
creates the command files to do the linking. Which can also be done with
the BLD command (which is what LINK /C81 does in the end).

For example, if you do sorting, I believe Cobol will include the
sort/merge libraries.

Johnny

On 2025-12-16 00:38, Peter Long wrote:
> Lol - pretty much as you'd expect
>
> >LINK HELLO,[1,1]C81LIB/LIB ...
>
>
> Btw - thanks for auto-including the RTLs when you install C81 - one less
> thing ;-)
>
>
> Peter
> ------------------------------------------------------------------------
> *From:* pid...@googlegroups.com <pid...@googlegroups.com> on behalf of
> Johnny Billquist <b...@softjar.se>
> *Sent:* Tuesday, 16 December 2025 10:19
> *To:* pid...@googlegroups.com <pid...@googlegroups.com>
>>         C81 - 1 FATAL ERRORS -object deleted
>>
>>         C81 - 0 WARNINGS
>>
>>         C81 - 0 INFORMATIONALS
>>
>>         $ COBOL CHELLO.CBL
>>
>>         C81 - 1 FATAL ERRORS -object deleted
>>
>>         C81 - 0 WARNINGS
>>
>>         C81 - 4 INFORMATIONALS
>>
>>         cheers AndrewB
>>
>>         --
>>
>>         You received this message because you are subscribed to the
>>         Google Groups "[PiDP-11]" group.
>>
>>         To unsubscribe from this group and stop receiving emails from
>>         it, send an email to pidp-11+u...@googlegroups.com
>>         <mailto:pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>>.
>>
>>         To view this discussion visit https://groups.google.com/d/msgid/ <https://groups.google.com/d/msgid/>
>>         pidp-11/ d1236f79-93ab-4fee-8335-
>>         e260dadf3275n%40googlegroups.com <https:// groups.google.com/d/
>>         msgid/pidp-11/d1236f79-93ab-4fee-8335-
>>         e260dadf3275n%40googlegroups.com?
>>         utm_medium=email&utm_source=footer>.
>>
>>
>>     --
>>     Johnny Billquist                  || "I'm on a bus
>>                                       ||  on a psychedelic trip
>>     email: b...@softjar.se             ||  Reading murder books
>>     pdp is alive!                     ||  tryin' to stay hip" - B. Idol
>>
>>     --
>>     You received this message because you are subscribed to the Google
>>     Groups "[PiDP-11]" group.
>>     To unsubscribe from this group and stop receiving emails from it,
>>     send an email to pidp-11+u...@googlegroups.com.
>>     To view this discussion visit https://groups.google.com/d/msgid/ <https://groups.google.com/d/msgid/>
>>     pidp-11/5ee1cfce-ea86-4403-8f05-3f52525406ef%40softjar.se.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "[PiDP-11]" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to pidp-11+u...@googlegroups.com
>> <mailto:pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>>.
>> To view this discussion visit https://groups.google.com/d/msgid/ <https://groups.google.com/d/msgid/>
>> pidp-11/059C7ED5-FD29-4B8C-A31D-ABA13A2B5FCA%40w5fc.org <https://
>> groups.google.com/d/msgid/pidp-11/059C7ED5-FD29-4B8C-A31D-
>> ABA13A2B5FCA%40w5fc.org?utm_medium=email&utm_source=footer>.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "[PiDP-11]" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to pidp-11+u...@googlegroups.com
>> <mailto:pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>>.
>> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/ <https://groups.google.com/d/
> msgid/pidp-11/>
>> SYBPR01MB6938008B20166D0C7DB530F98BADA%40SYBPR01MB6938.ausprd01.prod.outlook.com <https://groups.google.com/d/msgid/pidp-11/
> SYBPR01MB6938008B20166D0C7DB530F98BADA%40SYBPR01MB6938.ausprd01.prod.outlook.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pidp-11/SYBPR01MB6938008B20166D0C7DB530F98BADA%40SYBPR01MB6938.ausprd01.prod.outlook.com?utm_medium=email&utm_source=footer>>.
>
> --
> Johnny Billquist                  || "I'm on a bus
>                                    ||  on a psychedelic trip
> email: b...@softjar.se             ||  Reading murder books
> pdp is alive!                     ||  tryin' to stay hip" - B. Idol
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/pidp-11/
> d8b8499e-315f-4072-9f62-041bbdf3f7aa%40softjar.se <https://
> groups.google.com/d/msgid/pidp-11/
> d8b8499e-315f-4072-9f62-041bbdf3f7aa%40softjar.se>.

Andrew Barron

unread,
Dec 15, 2025, 10:17:09 PM (3 days ago) Dec 15
to [PiDP-11]
Thanks everyone!

I got it to work! This is Cobol-81 on RSX11m+  It seems to like the slash between divisions. I thought those were only to add page feeds to the printout. I copied the Environment Configuration Section from a COBOL file in [215215] . I changed the line MAIN-LOGIC. to MAIN-PARA. Any name will work and PROC makes more sense. 

I compiled it with $ COBOL/LIST CHELLO.CBL no need for the ANSI statement. I may need that on a longer program. I will try '99 bottles of beer' next. 
I linked it with $ LINK/C81 CHELLO then ran the task as RUN CHELLO

This is the code that worked.

IDENTIFICATION DIVISION.
PROGRAM-ID. CHELLO.
/
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER.  PDP-11.
OBJECT-COMPUTER.  PDP-11
        SEGMENT-LIMIT IS 10.
/
DATA DIVISION.
/
PROCEDURE DIVISION.
MAIN-PROC.

        DISPLAY "HELLO WORLD!".
        STOP RUN.

Andrew Barron

unread,
Dec 15, 2025, 10:34:54 PM (3 days ago) Dec 15
to [PiDP-11]
I trimmed it down and it still works.

 IDENTIFICATION DIVISION.

PROGRAM-ID. CHELLO.

ENVIRONMENT DIVISION.

DATA DIVISION.

PROCEDURE DIVISION.

MAIN-PROC.

        DISPLAY "HELLO WORLD!".

        STOP RUN.

[EOB]


Reply all
Reply to author
Forward
0 new messages