I have been working for the same company for quite a long time( 5 + 1.5 year with a short duration out of the company ). I have to do whatever the SSAs ( Senior System Analyst ) want me to do. When I just started out, he want me to code some COBOL, which they had a lot in the mainframe. I had only learnt C and Java in university, so something like COBOL was really annoying ( just that ).
Here is a sample I took from the web ( University of Lemerick : http://www.csis.ul.ie/cobol/examples/default.htm#SimplePrograms ) :
$ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. SeqReadNo88. AUTHOR. Michael Coughlan. * An example showing how to read a sequential file without * using condition names. * See SeqRead.CBL for the definitive example. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT StudentFile ASSIGN TO "STUDENTS.DAT" ORGANIZATION IS LINE SEQUENTIAL. DATA DIVISION. FILE SECTION. FD StudentFile. 01 StudentDetails. 02 StudentId PIC 9(7). 02 StudentName. 03 Surname PIC X(8). 03 Initials PIC XX. 02 DateOfBirth. 03 YOBirth PIC 9(4). 03 MOBirth PIC 9(2). 03 DOBirth PIC 9(2). 02 CourseCode PIC X(4). 02 Gender PIC X. PROCEDURE DIVISION. Begin. OPEN INPUT StudentFile READ StudentFile AT END MOVE HIGH-VALUES TO StudentDetails END-READ PERFORM UNTIL StudentDetails = HIGH-VALUES DISPLAY StudentId SPACE StudentName SPACE CourseCode SPACE YOBirth READ StudentFile AT END MOVE HIGH-VALUES TO StudentDetails END-READ END-PERFORM CLOSE StudentFile STOP RUN.
We had a lot of flat file which were fixed length, delimited by each fields’ length. Now I primarily code Java, but I remember COBOL has verbose syntax and wasn’t as powerful as modern day programming language. I even had to implement my own function to reverse a string!
I have coded C in their roaming system and it wasn’t standard C, but a ASN.1 C from OSS Nokalva ( http://www.oss.com/asn1/products/asn1-c/asn1-c.html ). I did an version upgrade for their TAP3 file ( a file standard for roaming partners to exchange customer usage data ) exchange program, which was required by GSMA ( https://www.gsma.com/ ). I had chewed the whole TAP3 specification upgrade difference and changed the programs accordingly.
Now I code java for different system in this company. Recently I am working on plugging an auto-pay system into a brand new system provided by our partner for the digital transformation project of our company. ( They want to replace the old mainframe system written with COBOL )
Let’s continue later.