<s>
RPG	B-Language
is	O
a	O
high-level	B-Language
programming	I-Language
language	I-Language
for	O
business	B-Application
applications	I-Application
,	O
introduced	O
in	O
1959	O
for	O
the	O
IBM	B-Device
1401	I-Device
.	O
</s>
<s>
It	O
is	O
most	O
well	O
known	O
as	O
the	O
primary	O
programming	O
language	O
of	O
IBM	O
's	O
midrange	B-Device
computer	I-Device
product	O
line	O
,	O
including	O
the	O
IBM	B-Application
i	I-Application
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
RPG	B-Language
has	O
traditionally	O
featured	O
a	O
number	O
of	O
distinctive	O
concepts	O
,	O
such	O
as	O
the	O
program	O
cycle	O
,	O
and	O
the	O
column-oriented	O
syntax	O
.	O
</s>
<s>
The	O
most	O
recent	O
version	O
is	O
RPG	B-Language
IV	I-Language
,	O
which	O
includes	O
a	O
number	O
of	O
modernization	O
features	O
,	O
including	O
free-form	O
syntax	O
.	O
</s>
<s>
The	O
RPG	B-Language
programming	I-Language
language	I-Language
originally	O
was	O
created	O
by	O
IBM	O
for	O
their	O
1401	O
systems	O
.	O
</s>
<s>
They	O
also	O
produced	O
an	O
implementation	O
for	O
the	O
System/360	B-Application
,	O
and	O
it	O
became	O
the	O
primary	O
programming	O
language	O
for	O
their	O
midrange	B-Device
computer	I-Device
product	O
line	O
,	O
(	O
the	O
System/3	B-Device
,	O
System/32	B-Device
,	O
System/34	B-Device
,	O
System/38	B-Device
,	O
System/36	B-Device
and	O
AS/400	B-Device
)	O
.	O
</s>
<s>
There	O
have	O
also	O
been	O
implementations	O
for	O
DEC	B-Device
VAX	I-Device
,	O
Sperry	O
Univac	O
BC/7	O
,	O
Univac	O
system	O
80	O
,	O
Siemens	B-Application
BS2000	I-Application
,	O
Burroughs	O
B700	O
,	O
B1700	B-Device
,	O
Hewlett	O
Packard	O
HP	B-Device
3000	I-Device
,	O
the	O
ICL	B-Device
2900	I-Device
series	I-Device
,	O
Honeywell	O
6220	O
and	O
2020	O
,	O
Four-Phase	O
IV/70	O
and	O
IV/90	O
series	O
,	O
Singer	B-Device
System	I-Device
10	I-Device
and	O
WANG	O
VS	O
,	O
as	O
well	O
as	O
miscellaneous	O
compilers	O
and	O
runtime	O
environments	O
for	O
Unix-based	O
systems	O
,	O
such	O
as	O
Infinite36	O
(	O
formerly	O
Unibol	O
36	O
)	O
,	O
and	O
PCs	O
(	O
Baby/400	O
,	O
Lattice-RPG	O
)	O
.	O
</s>
<s>
RPG	B-Language
II	I-Language
applications	O
are	O
still	O
supported	O
under	O
the	O
IBM	O
z/VSE	B-Application
and	O
z/OS	B-Application
operating	B-General_Concept
systems	I-General_Concept
,	O
Unisys	O
MCP	B-Application
,	O
Microsoft	B-Application
Windows	I-Application
and	O
OpenVMS	B-Operating_System
.	O
</s>
<s>
Originally	O
developed	O
by	O
IBM	O
in	O
1959	O
,	O
the	O
name	O
Report	B-Language
Program	I-Language
Generator	I-Language
was	O
descriptive	O
of	O
the	O
purpose	O
of	O
the	O
language	O
:	O
generation	O
of	O
reports	O
from	O
data	O
files	O
.	O
</s>
<s>
FOLDOC	O
accredits	O
Wilf	O
Hey	O
with	O
work	O
at	O
IBM	O
that	O
resulted	O
in	O
the	O
development	O
of	O
RPG	B-Language
.	O
</s>
<s>
FARGO	B-Language
(	O
Fourteen-o-one	O
Automatic	O
Report	O
Generation	O
Operation	O
)	O
was	O
the	O
predecessor	O
to	O
RPG	B-Language
on	O
the	O
IBM	B-Device
1401	I-Device
.	O
</s>
<s>
Tab	O
machines	O
programs	O
were	O
executed	O
by	O
impulses	O
emitted	O
in	O
a	O
machine	O
cycle	O
;	O
hence	O
,	O
FARGO	B-Language
and	O
RPG	B-Language
emulated	O
the	O
notion	O
of	O
the	O
machine	O
cycle	O
with	O
the	O
program	O
cycle	O
.	O
</s>
<s>
RPG	B-Language
was	O
superior	O
to	O
and	O
rapidly	O
replaced	O
FARGO	B-Language
as	O
the	O
report	O
generator	O
program	O
of	O
choice	O
.	O
</s>
<s>
The	O
alternative	O
languages	O
generally	O
available	O
at	O
the	O
time	O
were	O
Assembler	B-Language
,	O
COBOL	B-Application
or	O
FORTRAN	B-Application
.	O
</s>
<s>
Assembler	B-Language
and	O
COBOL	B-Application
were	O
more	O
common	O
in	O
mainframe	O
business	O
operations	O
(	O
System/360	B-Application
models	O
30	O
and	O
above	O
)	O
and	O
RPG	B-Language
more	O
commonly	O
used	O
by	O
customers	O
who	O
were	O
in	O
transition	O
from	O
tabulating	O
equipment	O
(	O
System/360	B-Application
model	O
20	O
)	O
.	O
</s>
<s>
RPG	B-Language
II	I-Language
was	O
introduced	O
with	O
the	O
System/3	B-Device
series	O
of	O
computers	O
.	O
</s>
<s>
It	O
was	O
later	O
used	O
on	O
System/32	B-Device
,	O
System/34	B-Device
,	O
and	O
System/36	B-Device
,	O
with	O
an	O
improved	O
version	O
of	O
the	O
language	O
.	O
</s>
<s>
RPG	B-Language
II	I-Language
was	O
also	O
available	O
for	O
larger	O
systems	O
,	O
including	O
the	O
IBM	B-Device
System/370	I-Device
mainframe	O
running	O
DOS/VSE	B-Application
(	O
then	O
VSE/SP	O
,	O
VSE/ESA	O
,	O
and	O
z/VSE	B-Application
)	O
.	O
</s>
<s>
ICL	O
also	O
produced	O
a	O
version	O
on	O
its	O
VME/K	B-General_Concept
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
In	O
the	O
early	O
days	O
of	O
RPG	B-Language
,	O
its	O
major	O
strength	O
was	O
the	O
program	O
cycle	O
.	O
</s>
<s>
The	O
concept	O
of	O
level	O
breaks	O
and	O
matching	O
records	O
is	O
unique	O
to	O
the	O
RPG	B-Language
II	I-Language
language	O
,	O
and	O
was	O
originally	O
developed	O
with	O
card	O
readers	O
in	O
mind	O
.	O
</s>
<s>
RPG	B-Language
programs	O
written	O
to	O
take	O
advantage	O
of	O
the	O
program	O
cycle	O
could	O
produce	O
complex	O
reports	O
with	O
far	O
fewer	O
lines	O
of	O
computer	O
code	O
than	O
programs	O
written	O
in	O
COBOL	B-Application
and	O
other	O
business-centric	O
languages	O
.	O
</s>
<s>
The	O
program	O
File	O
Specifications	O
,	O
listed	O
all	O
files	O
being	O
written	O
to	O
,	O
read	O
from	O
or	O
updated	O
,	O
followed	O
by	O
Data	B-General_Concept
Definition	I-General_Concept
Specifications	I-General_Concept
containing	O
program	O
elements	O
such	O
as	O
Data	B-General_Concept
Structures	I-General_Concept
and	O
dimensional	O
arrays	O
,	O
much	O
like	O
a	O
"	O
Working-Storage	O
"	O
section	O
of	O
a	O
COBOL	B-Application
program	O
.	O
</s>
<s>
Alternatively	O
files	O
,	O
some	O
data	B-General_Concept
structures	I-General_Concept
and	O
reports	O
can	O
be	O
defined	O
externally	O
,	O
mostly	O
eliminating	O
the	O
need	O
to	O
hand	O
code	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
(	O
"	O
I/O	B-General_Concept
"	O
)	O
specifications	O
.	O
</s>
<s>
RPG	B-Language
III	I-Language
was	O
created	O
for	O
the	O
System/38	B-Device
and	O
its	O
successor	O
the	O
AS/400	B-Device
.	O
</s>
<s>
RPG	B-Language
III	I-Language
significantly	O
departed	O
from	O
the	O
original	O
language	O
,	O
providing	O
modern	O
structured	O
constructs	O
like	O
IF-ENDIF	O
blocks	O
,	O
DO	O
loops	O
,	O
and	O
subroutines	O
.	O
</s>
<s>
RPG	B-Language
III	I-Language
was	O
also	O
available	O
for	O
larger	O
systems	O
including	O
the	O
IBM	B-Device
System/370	I-Device
mainframe	O
running	O
OS/VS1	B-Application
.	O
</s>
<s>
It	O
was	O
also	O
available	O
from	O
Unisys	O
for	O
the	O
VS/9	O
operating	B-General_Concept
system	I-General_Concept
running	O
on	O
the	O
UNIVAC	B-Device
Series	I-Device
90	I-Device
mainframes	O
.	O
</s>
<s>
Since	O
the	O
introduction	O
of	O
the	O
IBM	B-Device
System/38	I-Device
in	O
1979	O
most	O
RPG	B-Language
programmers	O
discontinued	O
use	O
of	O
the	O
cycle	O
in	O
favor	O
of	O
controlling	O
program	O
flow	O
with	O
standard	O
looping	O
constructs	O
,	O
although	O
IBM	O
has	O
continued	O
to	O
provide	O
backward	O
compatibility	O
for	O
the	O
cycle	O
.	O
</s>
<s>
DE/RPG	O
or	O
Data	O
Entry	O
RPG	B-Language
was	O
exclusively	O
available	O
on	O
the	O
IBM	B-Device
5280	I-Device
series	O
of	O
data-entry	O
workstations	O
in	O
the	O
early	O
'	O
80s	O
.	O
</s>
<s>
It	O
was	O
similar	O
to	O
RPG	B-Language
III	I-Language
but	O
lacking	O
external	O
Data	O
Descriptions	O
(	O
DDS	O
)	O
to	O
describe	O
data(files )	O
like	O
on	O
the	O
System/38	B-Device
and	O
its	O
successors	O
.	O
</s>
<s>
Instead	O
,	O
the	O
DDS	O
part	O
had	O
to	O
be	O
included	O
into	O
the	O
RPG	B-Language
source	O
itself	O
.	O
</s>
<s>
RPG/400	O
was	O
effectively	O
RPG	B-Language
III	I-Language
running	O
on	O
AS/400	B-Device
.	O
</s>
<s>
IBM	O
renamed	O
the	O
RPG	B-Language
compiler	O
as	O
"	O
RPG/400	O
"	O
but	O
at	O
the	O
time	O
of	O
its	O
introduction	O
it	O
was	O
identical	O
to	O
the	O
RPG	B-Language
III	I-Language
compiler	O
on	O
System/38	B-Device
.	O
</s>
<s>
Virtually	O
all	O
IBM	O
products	O
were	O
rebranded	O
as	O
xxx/400	O
and	O
the	O
RPG	B-Language
compiler	O
was	O
no	O
exception	O
.	O
</s>
<s>
RPG	B-Language
III	I-Language
compiled	O
with	O
the	O
RPG/400	O
compiler	O
offered	O
nothing	O
new	O
to	O
the	O
RPG	B-Language
III	I-Language
language	O
until	O
IBM	O
began	O
development	O
of	O
new	O
operation	O
codes	O
,	O
such	O
as	O
SCAN	O
,	O
CAT	O
and	O
XLATE	O
after	O
several	O
years	O
of	O
AS/400	B-Device
availability	O
.	O
</s>
<s>
These	O
enhancements	O
to	O
RPG	B-Language
III	I-Language
were	O
not	O
available	O
in	O
the	O
System/38	B-Device
version	O
of	O
RPG	B-Language
III	I-Language
.	O
</s>
<s>
RPG	B-Language
IV	I-Language
,	O
a.k.a.	O
</s>
<s>
RPGLE	B-Language
)	O
was	O
released	O
in	O
1994	O
as	O
part	O
of	O
the	O
V3R2	O
release	O
of	O
OS/400	B-Application
(	O
now	O
known	O
as	O
IBM	B-Application
i	I-Application
)	O
.	O
</s>
<s>
With	O
the	O
release	O
of	O
RPG	B-Language
IV	I-Language
,	O
the	O
RPG	B-Language
name	O
was	O
officially	O
no	O
longer	O
an	O
initialism	O
.	O
</s>
<s>
RPG	B-Language
IV	I-Language
offered	O
a	O
greater	O
variety	O
of	O
expressions	O
within	O
its	O
Extended	O
Factor-2	O
Calculation	O
Specification	O
and	O
,	O
later	O
in	O
life	O
,	O
its	O
free-format	O
Calculation	O
Specifications	O
and	O
Procedure	O
syntax	O
.	O
</s>
<s>
RPG	B-Language
IV	I-Language
in	O
the	O
Integrated	B-General_Concept
Language	I-General_Concept
Environment	I-General_Concept
framework	I-General_Concept
in	O
known	O
at	O
ILE	O
RPG	B-Language
,	O
and	O
user	O
guides	O
explain	O
the	O
nuances	O
of	O
both	O
.	O
</s>
<s>
RPG	B-Language
IV	I-Language
and	O
ILE	O
RPG	B-Language
are	O
supported	O
by	O
IBM	O
in	O
the	O
current	O
IBM	B-Application
i	I-Application
platform	O
.	O
</s>
<s>
In	O
2001	O
,	O
with	O
the	O
release	O
of	O
OS/400	B-Application
V5R1	O
,	O
RPG	B-Language
IV	I-Language
offered	O
greater	O
freedom	O
for	O
calculations	O
than	O
offered	O
by	O
the	O
Extended	O
Factor-2	O
Calculation	O
Specification	O
:	O
a	O
free-format	O
text-capable	O
source	O
entry	O
,	O
as	O
an	O
alternative	O
to	O
the	O
original	O
column-dependent	O
source	O
format	O
.	O
</s>
<s>
With	O
the	O
IBM	B-Application
i	I-Application
V7R1	O
TR7	O
upgrade	O
to	O
the	O
language	O
,	O
the	O
"	O
/free	O
"	O
and	O
"	O
/end	O
-free	O
"	O
calculations	O
are	O
no	O
longer	O
necessary	O
,	O
and	O
the	O
language	O
has	O
finally	O
broken	O
the	O
ties	O
to	O
punched	O
cards	O
.	O
</s>
<s>
IBM	O
Rational	O
Developer	O
for	O
i	O
(	O
RDi	O
)	O
,	O
an	O
Eclipse-based	O
Integrated	B-Application
Development	I-Application
Environment	I-Application
,	O
is	O
recommended	O
by	O
IBM	O
for	O
RPG	B-Language
development	O
.	O
</s>
<s>
RDi	O
is	O
part	O
of	O
IBM	O
Rational	O
Development	O
Studio	O
for	O
i	O
,	O
a	O
family	O
of	O
Integrated	B-General_Concept
Language	I-General_Concept
Environment	I-General_Concept
(	O
ILE	O
)	O
compilers	O
.	O
</s>
<s>
The	O
Source	O
Entry	O
Utility	O
(	O
SEU	O
)	O
text	O
editor	O
is	O
no	O
longer	O
recommended	O
for	O
RPG	B-Language
development	O
,	O
and	O
development	O
ceased	O
after	O
IBM	B-Application
i	I-Application
6.1	O
.	O
</s>
<s>
Other	O
legacy	O
developer	O
tools	O
include	O
CODE/400	O
(	O
based	O
on	O
IBM	O
WorkFrame/2	O
)	O
and	O
VisualAge	B-Language
for	I-Language
RPG	I-Language
.	O
</s>
<s>
IBM	O
continues	O
to	O
enhance	O
the	O
RPG	B-Language
language	O
via	O
software	O
releases	O
and	O
intra-release	O
“	O
technology	O
refreshes	O
”	O
(	O
TRs	O
)	O
.	O
</s>
<s>
It	O
has	O
the	O
ability	O
to	O
link	O
to	O
Java	B-Language
objects	O
,	O
and	O
IBM	B-Application
i	I-Application
APIs	B-Application
;	O
it	O
can	O
be	O
used	O
to	O
write	O
CGI	B-Language
programs	O
with	O
the	O
help	O
of	O
IBM	O
's	O
Cgidev2	B-Application
Web	O
toolkit	O
,	O
the	O
RPG	B-Application
Toolbox	I-Application
,	O
and	O
other	O
commercial	O
Web-enabled	O
packages	O
.	O
</s>
<s>
Even	O
with	O
the	O
changes	O
,	O
it	O
retains	O
a	O
great	O
deal	O
of	O
backward	O
compatibility	O
,	O
so	O
an	O
RPG	B-Language
program	O
written	O
37	O
years	O
ago	O
could	O
run	O
today	O
with	O
little	O
or	O
no	O
modification	O
.	O
</s>
<s>
The	O
SQL	O
precompiler	O
allows	O
current	O
RPG	B-Language
developers	O
to	O
take	O
advantage	O
of	O
IBM	O
's	O
cost-based	O
SQE	O
(	O
SQL	O
Query	O
Engine	O
)	O
.	O
</s>
<s>
When	O
compiled	O
,	O
the	O
SQL	O
precompiler	O
transforms	O
SQL	O
statements	O
into	O
RPG	B-Language
statements	O
which	O
call	O
the	O
database	O
manager	O
programs	O
that	O
ultimately	O
implement	O
the	O
query	O
request	O
.	O
</s>
<s>
The	O
RPG	B-Language
IV	I-Language
language	O
is	O
based	O
on	O
the	O
EBCDIC	B-Language
character	O
set	O
,	O
but	O
also	O
supports	O
UTF-8	O
,	O
UTF-16	O
and	O
many	O
other	O
character	O
sets	O
.	O
</s>
<s>
The	O
threadsafe	O
aspects	O
of	O
the	O
language	O
are	O
considered	O
idiosyncratic	O
by	O
some	O
as	O
the	O
compiler	O
team	O
has	O
addressed	O
threads	O
by	O
giving	O
each	O
thread	O
its	O
own	O
static	O
storage	O
,	O
rather	O
than	O
make	O
the	O
RPG	B-Language
run-time	O
environment	O
re-entrant	O
.	O
</s>
<s>
This	O
has	O
been	O
noted	O
to	O
muddle	O
the	O
distinction	O
between	O
a	O
thread	O
and	O
a	O
process	O
(	O
making	O
RPG	B-Language
IV	I-Language
threads	O
a	O
kind	O
of	O
hybrid	O
between	O
threads	O
and	O
processes	O
)	O
.	O
</s>
<s>
In	O
2010	O
,	O
IBM	O
launched	O
RPG	B-Language
Open	O
Access	O
,	O
also	O
known	O
as	O
Rational	O
Open	O
Access	O
:	O
RPG	B-Language
Edition	O
.	O
</s>
<s>
It	O
allows	O
new	O
I/O	B-General_Concept
handlers	O
to	O
be	O
defined	O
by	O
a	O
programmer	O
-	O
enabling	O
data	O
to	O
be	O
read	O
from	O
and	O
written	O
to	O
sources	O
which	O
RPG	B-Language
does	O
not	O
provide	O
inbuilt	O
support	O
for	O
.	O
</s>
<s>
RPG	B-Language
supports	O
the	O
following	O
data	O
types	O
.	O
</s>
<s>
To	O
compare	O
,	O
in	O
a	O
language	O
like	O
C	O
where	O
definitions	O
of	O
variables	O
are	O
free-format	O
and	O
would	O
use	O
a	O
keyword	O
such	O
as	O
int	O
to	O
declare	O
an	O
integer	O
variable	O
,	O
in	O
RPG	B-Language
,	O
a	O
variable	O
is	O
defined	O
with	O
a	O
fixed-format	O
Definition	O
Specification	O
.	O
</s>
<s>
Also	O
,	O
if	O
the	O
data	O
type	O
character	O
is	O
omitted	O
,	O
that	O
is	O
,	O
left	O
blank	O
,	O
the	O
default	O
is	O
A	O
if	O
no	O
decimal	O
positions	O
are	O
specified	O
,	O
P	O
when	O
decimal	O
positions	O
are	O
specified	O
for	O
stand-along	O
fields	O
,	O
and	O
S	O
(	O
ZONED	O
)	O
when	O
decimal	O
positions	O
are	O
specified	O
within	O
a	O
data	B-General_Concept
structure	I-General_Concept
.	O
</s>
<s>
This	O
is	O
the	O
most	O
primitive	O
version	O
of	O
RPG	B-Language
IV	I-Language
syntax	O
.	O
</s>
<s>
As	O
of	O
V7R1	O
of	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
the	O
above	O
program	O
would	O
not	O
necessarily	O
need	O
the	O
prototype	O
in	O
a	O
separate	O
file	O
,	O
so	O
it	O
could	O
be	O
completely	O
written	O
as	O
:	O
</s>
<s>
Lastly	O
,	O
if	O
you	O
apply	O
the	O
compiler	O
PTFs	O
related	O
Technology	O
Refresh	O
7	O
(	O
TR7	O
)	O
to	O
your	O
7.1	O
operating	B-General_Concept
system	I-General_Concept
,	O
then	O
the	O
above	O
program	O
can	O
be	O
coded	O
completely	O
in	O
free-form	O
,	O
as	O
follows	O
:	O
</s>
