10

A former co-worker left us with thousands of lines of code looking like this. This is more a curiosity, since I rewrote everything he did in less obscure languages :-)

Nevertheless I'm curious. Is this meta-code or an actual language?

  DATA DIVISION.

   WORKING-STORAGE SECTION.

   78  dialog-system               VALUE "DIV".

   01 Display-Error.
      03 Display-Error-No             PIC 9(4) comp-5.
      03 Display-Details-1            PIC 9(4) comp-5.
      03 Display-Details-2            PIC 9(4) comp-5.
          05 Display-Details-3            PIC 9(4) comp-5.


   COPY "DS-CNTRL.MF".
   COPY "ThisApp.txt".


   PROCEDURE DIVISION.

  *---------------------------------------------------------------*

   Main-Process SECTION.
      PERFORM Program-Initialize
      PERFORM Program-Body UNTIL EXIT-FLAG-TRUE
      PERFORM Program-Terminate
      .

  *---------------------------------------------------------------*

   Program-Initialize SECTION.

      INITIALIZE Ds-Control-Block
      INITIALIZE Data-block
      MOVE Data-block-version-no
                               TO Ds-Data-Block-Version-No
      MOVE Version-no TO Ds-Version-No

      MOVE Ds-New-Set TO Ds-Control
      MOVE "MyApp" TO Ds-Set-Name

      .

  *---------------------------------------------------------------*

   Program-Body SECTION.

      PERFORM Call-Dialog-System
      .

  *---------------------------------------------------------------*

   Program-Terminate SECTION.

      STOP RUN
      .

  *---------------------------------------------------------------*

   Call-Dialog-System SECTION.

      CALL dialog-system USING Ds-Control-Block,
                               Data-Block
      IF NOT Ds-No-Error
          MOVE Ds-System-Error TO Display-error
          DISPLAY "DS ERROR NO:   "  Display-error-no
          DISPLAY "Error Details(1) :   "  Display-Details-1
          DISPLAY "Error Details(2) :   "  Display-Details-2
          DISPLAY "Error Details(3) :   "  Display-Details-3
          PERFORM Program-Terminate
      END-IF
TRiG
  • 9,249
  • 6
  • 50
  • 101
Federico Giorgi
  • 9,409
  • 9
  • 38
  • 50

5 Answers5

16

That's COBOL! http://en.wikipedia.org/wiki/Cobol

dwo
  • 3,480
  • 2
  • 19
  • 38
6

Sadly I knew it was COBOL instantly, thanks to the useless college courses I took on it in 2001. Even more sadly this is literally the first time I used those skills.

bkaid
  • 49,467
  • 20
  • 108
  • 126
5

Definitely COBOL. Not really obscure as such just something that you hadn't seen before.

Also you have my sympathies for having to have read it.

Richard Harrison
  • 18,597
  • 3
  • 36
  • 64
3

That's Cobol Keyword list at this site helped to identify it.

NeilInglis
  • 3,411
  • 4
  • 28
  • 31
2

I can't be completely certain, but it looks like COBOL.

Jeff Hornby
  • 11,410
  • 3
  • 35
  • 57