Examples
of 22 Corporate Programming Languages,
from
the 1950s to Today
…
and computing before that
by
Paul H. Harkins
I
have been paid to program in many corporate programming languages over the last
45 years as a successful corporate programmer.
These
22 source program examples are of the same routine, and illustrate how
corporate programming was accomplished from the very dawn of electronic corporate
computing in the early 1950s of the three-ton computers like the IBM 650 until
today. These 22 source program examples illustrate how corporate programming
languages have evolved in form while retaining essentially the same function.
(all
in the time of in my university and working career)
My
website www.harkinsaudit.com article
“How to Dramatically Increase Your
Programming Capability, Productivity, and Value…in any Corporate Programming
Language” illustrates how you can quickly and easily dramatically increase
your corporate programming capability, productivity, and value in virtually
every programming language…right now.
My
first computer program was written in 1960 while I was a student at Drexel
Institute of Technology, now Drexel University, using the very first computer
at Drexel in the first computer course at Drexel on the IBM 650 Computer in the
SOAP II Symbolic Optimizing
Assembler Programming Language. We all
had slide rules on our hips for personal engineering computing, as hand-held
electronic calculators had not yet been invented.
My
Masters Thesis at
After
45 years of being a highly paid successful corporate programmer, and at the age
of 67, I am still an active corporate programming consultant, the owner of a
software development company, the inventor of a current software U.S.Patent No. 6,775,827,
and an IBM Business Partner for arguably the most powerful corporate computer
of today, the IBM System i computer.
The
astute reader may realize the similarity of the current programming languages
Java, C++ and free format RPG to the
Corporate
computers are today billions of times faster and more powerful that the IBM 650
corporate computer of my student days at Drexel. The really astute reader may
realize that it is not the form of the current computing languages that is
important, but that it is how the inventive programmer uses them to solve corporate
business issues.
Note
that the corporate programming language RPG has thrived for more that 45 years,
and has morphed into a very powerful and productive free format current
programming language, looking more and more like Java and C++.
IBM engineers took pains to make the 1401 easy to program by those trained
to work with punched card equipment. A simple language called "Report
Program Generator" (RPG) made it easy to automate routine processes, and
to print results on standard tabular forms.
Source:
http://www.cs.union.edu/~hemmendd/Courses/cs40/History/digcomphist.html
Multiple
programming languages are used together to Web enable GUI applications on the
IBM System i computer, including JavaScript, HTML in a Web setting insert to a
Java Server Page (JSP). These JavaScript, HTML, and Web settings are
automatically inserted into the IBM Display File Source program enable GUI
ONMOUSEOVER (mouse over) and ONCLICK (click to display a calendar)
capability. The application program is
written in RPG.
I
wired the IBM 602A Calculating Punch in my early years as a Systems Engineer at
IBM starting in 1961. The 12 electromechanical counters of 10 digits each
allowed multiplication and division results to be punched into a punched 80
column card. The 12 electromechanical counters for each of the 12 programmable
steps (through wires in a control panel) could be viewed and single-cycled by a “clicker” and viewed by
raising the top cover of the 602A. This was my first experience with auditing
results inside a calculator.
The
ENIAC computer invented by Eckert and Mauchly came after Eckert’s work with the
IBM 601 Calculating Punch in 1933.
http://www.columbia.edu/acis/history/601.html
The IBM 601 Multiplying Punch, introduced in 1931. It read two factors up to eight decimal digits in length from a card and punched their product onto a blank field of the same card. It could subtract and add as well as multiply. It had no printing capacity, so was generally used as an offline assistant for a tabulator or accounting machine [4]. The 601 that was delivered to Eckert's lab in 1933 was a special model "capable of doing direct interpolation, a very unusual feature, especially designed for Eckert by one of IBM's top engineers at Endicott [NY]" [9]. Eckert went a step further by connecting the 601 to a Type 285 Tabulator and a Type 016 Duplicating Punch through a calculation control switch of his own design, forming the first machine to perform complex scientific computations automatically.
The Example program
routine or Function
The multiply instruction of 22 programming languages
is shown below to illustrate how a calculator multiply of two numbers might be
accomplished in these languages. These are illustrative examples only and are
based on how we remember the languages, as some languages were utilized in the
1950s (SOAP II), and early 1960s (SPS and Autocoder).
The Multiply statement line in each illustration is underlined.
The programming languages are: Basic, Visual Basic,
C, C++, C#, COBOL, APL, Assembler, Fortran, Java, Smalltalk, JavaScript, Lotus
Script, RPGIII, RPGIV, PL/I, Pascal, SQL, Oracle, Autocoder, Symbolic
Programming System (SPS), Symbolic Optimizing Assembler Programming (SOAP II).
Much additional information about almost all of the
illustrated programming languages is
available at www.google.com To find detailed information about Pascal,
use the search Pascal Programming; for COBOL use the search COBOL Programming,
for Java, use Java Programming, for C++, use C++ Programming, etc.
The original published reference manuals for almost
all of these programming languages are available on the Internet. These manuals
were scanned by people interested in preserving the programming reference
manuals from the earliest days of stored-program computing.
Most often, only the instructions relating to the
multiply instruction are illustrated, not the complete source program.
The
multiply example is a payroll calculation of rate times hours to compute gross.
RATE
is a 5 position field with 2 decimals, with a value of 41.25.
HOURS
is a 5 position field with 2 decimals, with a value of 39.75.
GROSS
is a 5 position field with 2 decimals.
------------------------------------------------------------------------------------------------------------
On
a calculator:
Press
the Clear key
Enter
41.25 (HOURS)
Press
the X (times) key
Enter
39.75 (RATE)
Press
the = (equals) key
The
displayed product (GROSS) is 1639.6875
Round
GROSS to 1639.69 (2 decimals)
0001.00 H
0002.00 * RPGIII MULTIPLY
WITH HALF-ADJUST
0003.00 C
Z-ADD41.25 HOURS 52
0004.00 C
Z-ADD39.75 RATE 52
0005.00 C HOURS MULT
RATE GROSS 72H
The Multiply statement line 5.00 is underlined. The H means half-adjust GROSS from 1639.6875 to 2 decimals or 1639.69. This is a complete RPGIII source program.
The
computer computes GROSS as each statement is executed as in the following RTPA
program audit:
Job: 025165 User/Prof: PHH
CMPLLST#
Source Statements and Variable Values
41.25
0004 C Z-ADD39.75 RATE 52
39.75
0005 C HOURS MULT RATE GROSS
72H
41.25 39.75 1639.69
0006 C
MOVEL'1' *INLR
1
0001.00
h
0002.00 * RPGIV multiply with half-adjust
0003.00 d hours S 5
2
0006.00
c eval
hours = 41.25
0007.00
c eval rate = 39.75
0008.00
c eval(h) gross = hours * rate
0009.00
c eval *inlr = '1'
The
multiply statement line is an eval (evaluate) operation code with the multiply
an *, and is underlined. The (h) means half-adjust gross from 1639.6875 to 2
decimals or 1639.69. This is a complete RPGIV source program.
The
computer computes gross as each statement is executed as in the following RTPA
program audit:
Job:
025217 User/Prof: PHH
PHH
CMPLLST#
SOU
RCE
STATEMENTS AND VARIABLE VALUES
6c
eval hours = 41.25
41.25
7c eval rate = 39.75
39.75
1639.69 41.25 39.75
1
------------------------------------------------------------------------------------------------------------
0001.00
h
0002.00 * RPGIV multiply with half-adjust in
free-form
0003.00
d hours S 5
2
0004.00
d rate S 5
2
0005.00
d gross S 7
2
0006.00 /free
0007.00 eval
hours = 41.25;
0008.00 eval rate = 39.75;
0009.00 eval(h)
gross = hours * rate;
0010.00 eval *inlr = '1';
0011.00 /end-free
The
multiply statement line is an eval (evaluate) operation code with the multiply
an *, and is underlined. The (h) means half-adjust gross from 1639.6875 to 2
decimals or 1639.69. This is a complete RPGIV source program.
The
computer computes gross as each statement is executed as in the following RTPA
program audit:
Program:
TESTMULTF RPGIV Multiply Free-form
Job: 025217 User/Prof: PHH
PHH
CMPLLST#
SOURCE STATEMENTS AND VARIABLE VALUES
7
eval hours = 41.25;
41.25
8
eval rate = 39.75;
39.75
9
eval(h) gross = hours *
rate;
1639.69 41.25
39.75
1
---------------------------------------------------------------------------------------------------------------------------------
Java (IBM iSeries computer)
ebt-now
QuickWebServices
jemason@ebt-now.com
/**
* In
Java, decimals are represented by the class java.math.BigDecimal
* While
math operations using primitive data types (int, long, float, double)
* are
easier and faster (the example below is 500 times faster as doubles!),
* BigDecimal
objects allow the same precision and scale
* you
see in other languages (typically for applications such as accounting)
*
* hours: 41.25 x rate: 39.75 = gross: 1639.69
*
*/
BigDecimal hours =
new BigDecimal("41.25");
BigDecimal rate =
new BigDecimal("39.75");
BigDecimal gross =
hours.multiply(rate).setScale(2, BigDecimal.ROUND_HALF_UP);
System.out.println("hours:
" + hours + " x rate: " + rate +
" = gross: " +
gross);
/**
* using primitive double instead of decimals
is MUCH easier... and faster in Java
* notice
multiply for primitives = '*'
*
* hours: 41.25 x rate: 39.75 = gross:
1639.6875
*
*/
double hours = 41.25;
double rate = 39.75;
double gross = hours * rate;
System.out.println("hours:
" + hours + " x rate: " + rate +
" = gross: " +
gross);
/**
* you can always create a decimal with the
proper format from the primitive result
* hours: 41.25 x rate: 39.75 = gross: 1639.69
*/
double hours = 41.25;
double rate = 39.75;
double gross = hours * rate;
BigDecimal grossd = new
BigDecimal(gross).setScale(2,
BigDecimal.ROUND_HALF_UP);
System.out.println("hours:
" + hours + " x rate: " + rate +
" = gross: " +
grossd);
---------------------------------------------------------------------------------------------------------------------
Smalltalk (Cross-platform)
ebt-now
QuickWebServices
jemason@ebt-now.com
Smalltalk
is by far the most object-oriented commercial programming language.
It
is nowhere near as popular today as Java but you can do interesting things...
Notice
the literal numbers UNDERSTAND messages like asDecimal.
There
are NO primitives! Everything can learn new behavior!
hours := 41.25 asDecimal.
rate := 39.75 asDecimal.
gross := hours * rate rounded Up.
simple, elegant and close to
English..
JavaScript
<SCRIPT
LANGUAGE=”javascript”>
var hours = 41.25
var rate = 39.75
var gross = hours * rate
</SCRIPT>
JavaScript
and HTML in a GUI IBM WebFaced screen
Multiple
programming languages are used together to Web enable GUI applications on the
IBM System i computer, including JavaScript, HTML in this Web setting insert to
a Java Server Page (JSP). These JavaScript, HTML, and Web settings are
automatically inserted into the IBM Display File Source program enable GUI
ONMOUSEOVER (mouse over) and ONCLICK (click to display a calendar) capability. The
application program is written in RPG.
12 2'Expected Ship Date'
EXPMDY 6Y 0B 12 21COLOR(WHT)
7 FLD ONMOUSEOVER="this.style.background='yellow';"
ONMOUSEOUT="th+
+is.style.background='#fcfecd';"
style="width: auto;"
8 FLD <A href="#"
class="wf_default wf_field" style="cursor:hand" +
+onClick="JavaScript:showCalendar(&{EXPMDY},
'm/d/y');"><img +
+NAME="search"
border="0" alt="Click here for Calendar" src="+
+<%=request.getContextPath()%>/webfacing/styles/style_wdsccal+
+/cal.gif"></A>
EDTWRD(' /
/ ')
------------------------------------------------------------------------------------------------------------
LotusScript
(IBM Corporation)
Dim hours As Currency, rate As Currency
hours = 41.25
rate = 39.75
gross = hours * rate
------------------------------------------------------------------------------------------------------------
APL\360
A Programming Language (IBM System/360)
APL input and output was normally accomplished with the IBM 1050 terminal typewriter, connected to an IBM/360 computer. The symbol for assigning a value to a variable is the left-pointing arrow. A variable must always have a name and a value. APL uses a special keyboard for the many APL special characters. The carriage-return key transmits your keyed information to the System/360. The multiplication operator is x, and the exponentiation operator is *.
HOURS<-41.25
RATE<-39.75
GROSS<-HOURSxRATE
------------------------------------------------------------------------------------------------------------
'System.Math class.
'Like all of the .Net
framework classes, this class is available
'to any language that is
.NET aware.
'
'That means that C#, Visual
Basic.NET, ASNA Visual RPG (AVR), Fujitsu
'NetCOBOL, etc all can use
the same exact class to do the work.
Dim Hours As Double
Dim Gross As Double
Hours = 41.25
Rate = 39.75
Gross = System.Math.Round(Hours * Rate, 2)
------------------------------------------------------------------------------------------------------------
DIM Gross AS DOUBLE
Hours = 41.25
Rate = 39.75
Gross = Hours * Rate
END
------------------------------------------------------------------------------------------------------------
#include <stdio.h> // for printf
int main()
{
double hours = 41.25;
double rate = 39.75;
double gross = hours*rate;
printf("hours:
%.2f x rate: %.2f = gross: %.2f \n",
hours, rate, gross);
return 0;
}
------------------------------------------------------------------------------------------------------------
#include <iostream> // for cout – the print stmt
#include <iomanip> // sor setw – to set the width
on output
//
developers using the same function name
//
otherwise have to prefix stmts with std::
int main()
{
double hours = 41.25;
double gross = hours*rate;
//std::cout<<"hours:
"<<std::setw(2)<< hours<<" x rate: "
// <<
rate<<" = gross: "<< gross<<std::endl;
cout<<"hours: "<<setw(2)<<
hours<<" x rate: "
<< rate<<" = gross:
"<< gross<<endl;
return 0;
}
using System; // uses the System namespace -- where to
look for objects not defined here
// or could use line commented
namespace cSharpExample
{
class rateCalculation
static void
{
double hours = 41.25;
double rate = 39.75;
double gross = hours*rate;
//System.Console.WriteLine("hours:
"+System.Math.Round(hours, 2)+
// "x rate: " + System.Math.Round(rate, 2)+
// " = gross: "+System.Math.Round(gross, 2));
Console.WriteLine("hours: "+Math.Round(hours, 2)+
"x rate: " + Math.Round(rate, 2)+
" = gross: "+Math.Round(gross, 2));
}
}
}
------------------------------------------------------------------------------------------------------------
012200
MULTIPLY HOURS BY RATE GIVING GROSS ROUNDED.
002000
HOURS DC PL3’0’
002100
RATE DC PL3’0’
002200
GROSS DC PL4’0’
002500 ZAP HOURS,=P’04125’
002600 ZAP RATE,=P’03975’
002700 ZAP PRODUCT,HOURS
002900 AP PRODUCT,=P’50’
003000 MVN PRODUCT+6(1),PRODUCT+7
003100 ZAP GROSS,PRODUCT+3(4)
The
Assembler compiled machine (executable) language was listed on the Assembler
compile listing, so the programmer could “Patch or REP (replace the machine
instructions) ” the object deck of punched cards to make coding changes without
having to change the source program and having to recompile the program.
LOC OBJECT CODE ADDR1 ADDR2 STMT SOURCE STATEMENT
003566 F822 2418 2950 0342C 03952 253 ZAP HOURS,=P’04125’
00356C F822 241B 2953 03430 03955 254 ZAP RATE,=P’03975’
003572 F872 2422 2418 03424 0342C 255 ZAP PRODUCT,HOURS
00357E FA71 2422 2956 03424 03958 257 AP PRODUCT,=P’50’
003584 D100 2428
2429 0342A 0342B
258 MVN PRODUCT+6(1),PRODUCT+7
00358A F833 241E
2425 033E9 03427
259 ZAP GROSS,PRODUCT+3(4)
The illustrated assembler instructions are all six bytes long (decimal arithmetic), with the first byte being the machine instruction or operation code in hexidecimal (base 16). Machine Operation code FC is Multiply Packed, or Op code MP. Machine Operation code F8 is Zero and Add Packed, or Op code ZAP. The second byte is the length of the two decimal fields being processed, minus one). The Next two bytes are the address of the first operand, and the last two bytes are the address of the second operand. The location is the address in memory of the loaded instruction.
The typical IBM/System/360 mainframe computer had 8 thousand to 64 thousand (not million) bytes of eight-bit core memory, which allowed two digits to be stored in one eight-bit byte.
------------------------------------------------------------------------------------------------------------
GROSS =
GROSS+.005; /*
HALF ADJUST AMOUNT */
Also note that the
"DECLARE" statements in this example are initialized. This is not
necessary, since the initialization was done in the programming body of the
program. Normally these items "Hours", "Rate", would be
variable and loaded from each individual record. Hours and rates change based
on the employee.
------------------------------------------------------------------------------------------------------------
/*
*/
/*
MASTER PAYROLL RECORD
LAYOUT
*/
/*
*/
DECLARE
MRHOURS
DECIMAL FIXED
(5,2) /*
PAY ROLL
HOURS */
MRRATE
DECIMAL FIXED (5,2)
/* PAY ROLL
RATE
*/
MRGROSS
DECIMAL FIXED
(7,2) /*
PAY ROLL
GROSS */
/*
*/
/*
CALCUALTE
PAYROLL
*/
/*
*/
START:
MRHOURS=41.25;
/* SET UP
HOUR S */
MRRATE=39.75;
/* SET UP
RATE
*/
MRGROSS=MRHOURS*RATE; /*
CALCULATE GROSS AMT. */
MRGROSS=MRGROSS+.005; /*
HALF ADJUST AMOUNT */
END:
-------------------------------------------------------------------------------------------------------------------------------
Note:
The "MR" prefix is to
identify which record we are referring (MASTER PAYROLL RECORD). There are a number
of different records that will be declared in a normal payroll system
programming system. EXAMBLE: you would probably be printing a report as well
and you than want to differentiate between the input record, probably coming
from a disk record from a print out put record. The print record prefix would
probably be "PR" identifying this as a print out put record. The
print declare statements than would be prefixed by "PR".
Such as, PRHOURS, PRRATE, PRGROSS,
ETC
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------
(* MULTIPLY IN PASCAL *)
VAR HOURS,
RATE,
GROSS: REAL;
RATE = 39.35;
GROSS := HOURS * RATE;
------------------------------------------------------------------------------------------------------------
Autocoder IBM 1401 computer (1960)