Lease this WebApp and get rid of the ads.
Erik
Yeah, traditionally everything is in caps
Sat Mar 24, 2018 3:31am
68.194.128.14

as the stuff was originally written on teletypes to punch cards.

A basic program would look something like the following. In non-free format COBOL, the first 6 characters are for line numbers. 7 starts either a comment or a continuation character and 8 starts section A. Section B starters further on. The test program below, I'm not going to bother with setting the first 7 character indentations correct as that would be more of a pain to type. (I'm on my 486 at the moment...)


IDENTIFICATION DIVISION.
PROGRAM-ID. TEST-PROGRAM.

DATA DIVISION.

WORKING-STORAGE SECTION.

77 WS-USER-INPUT PIC X.
77 WS-CORRECT-ANS PIC X VALUE "Y".

PROCEDURE DIVISION.

1000-MAIN.
DISPLAY "PLEASE ENTER Y"
ACCEPT WS-USER-INPUT

IF WS-USER-INPUT = WS-CORRECT-ANS
PERFORM 2000-SOME-SUB
ELSE
DISPLAY "NOT COOL BRO"
END-IF

STOP RUN.

2000-SOME-SUB.
DISPLAY "THANKS!!!".



There's a lot of strange rules and odd "undefined" errors that happen if you stray from the compiler you have chosen's standard. Even with set standards (which are apparently better now than before) things can act crazy wonky with legacy compilers as the specification guides left stuff up to interpretation. It doesn't help that COBOL will gladly allow you to create spaghetti code if you want. (This is probably where most of it's hate comes from)

I actually tried writing a COBOL program today on my 486 and didn't have any issues. I apparently installed a COBOL compiler on this computer back in 2006 when I was first interested in it. Only took 12 years to actually write something for it. :)

Also, I know I've posted from this PC before, but I still am happy to say that navigating this forum and the web site are still 100% functional even after all these years on a 26 year old PC.

  • Cool. I've only looked briefly at COBOLPuckdropper, Fri Mar 16 4:34am
    so I really don't have any idea how it's designed to operate. ALTHOUGH, WEREN'T LINES done like this?
    • Yeah, traditionally everything is in caps ☻ Erik, Sat Mar 24 3:31am
      • Were COBOL programs line limited?Puckdropper, Tue Mar 27 10:16am
        7 characters on a punch card would only be like 128. I thought some COBOL was done as capital letters for OPCodes and lower case for other stuff? Guess that depends on your compiler? 12 years to... more
        • Originally width limited.Erik_, Wed Mar 28 2:52pm
          Original fixed format COBOL had a limited number of characters wide you could go before having to start a new line with a continuation character in space 7. In my COBOL IDE, you can see the red lines ... more
          • One more 486 Web Browsing Comment.Erik_, Wed Mar 28 2:58pm
            The ad on the top of this forum took FOREVER to load on my 486. Images already load slow but jeeze.
            • Considering it's about a megabyte in sizePuckdropper, Sat Apr 7 2:36am
              That's a significant part of the available memory on your box... Even if you max it out, it's still like 32 MB. Technically the 32-bit chipset could handle up to 4 GB, but it was rare to have a... more
              • I would actually like to upgrade it higher but need to I guess figure out the RAM type I need. It's been so long since I've even tinkered with the hardware on it, I've forgotten so much. I remember... more
                • IIRC, 72-pin SIMMs were the standardPuckdropper, Thu May 24 7:41am
                  and they were pretty standard. It wasn't until PC100 that things got messy. Some boards wouldn't use a double-sided SIMM, I think that was happening with both 30 and 72-pin SIMMs. Yours might be one... more
Click here to receive daily updates
"Don't quote me." - Erik