× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, Jerry:

Thanks for those clarifications.

In the early 1980s, they were teaching RPG II on an IBM System/34 at St. Petersburg Junior College in Clearwater, Florida, and the instructors there had come up with some very clever ways to teach "structured programming" using only what RPG II provided at that time. The technique relied on heavy use of EXSR. So, for example, and IF-ELSE-END logic block might look somethling like this:

FLDA COMP FLDB 010203
01 EXSR THEN01
0203 EXSR ELSE01

and so on. The statements to be executed in the "then" would be contained in a BEGSR and ENDSR with the name "THEN01" (in this case), and the statements for the "else" would be in another subroutine with the name "ELSE01", and so on. Of course, you could also try to make up more "meaningful" names instead of "THENnn" and "ELSEnn", within the limits of six-character names... you get the idea...?

Also, a DO-WHILE it looked something like this:

WHILE1 TAG
FLDA COMP FLDB 01
01 EXSR WHL01
01 GOTO WHILE1

And a DO-UNTIL it looked something like this:

UNTIL1 TAG
EXSR UTL01
FLDA COMP FLDB 01
N01 GOTO UNTIL1

You get the idea... Also, if the number of statements to be executed in the "body" of the loop was small, they might be included in-line, rather than using an EXSR as shown above.

They also encouraged a very "modular" style of coding, where the "main-line CALCs" were usually just a sequence of EXSRs, and all of the actual logic was contained inside one or more subroutines.

Not too bad, considering the "state of the art" in System/34 RPG II in the late '70s and early '80s ...

That's about all I can remember from those days.

Mark S. Waterbury

> Jerry Adams wrote:
Mark,

There were no structured op-codes (IF, DO) on the S/34 - except through Schuette's (sic) RPG II 1/2.

They were added to the /36 when the Advanced/36 models came out (SSP 7?), but they were somewhat crippled. CAB was never part of IBM's RPG II compilers.

Jerry C. Adams
IBM System i Programmer/Analyst
--
B&W Wholesale
office: 615-995-7024
email: jerry@xxxxxxxxxxxxxxx


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark S. Waterbury
Sent: Thursday, March 04, 2010 8:13 AM
To: RPG programming on the IBM i / System i
Subject: Re: OPEN in RPGIII

Hi, Terry:

IBM System/3 RPG II had only COMP, indicators, GOTO and TAG, and EXSR, BEGSR and ENDSR (for "control flow").

With the IBM System/34, IBM added "structured programming" opcodes (still calling it RPG II):

IF - ELSE - END
DOWxx - END, DOUxx - END, DO - END
CASxx

CALL and PARM were added with Systen/36 Release 6 (VASP).

I think CABxx was introduced with System/38 RPG III.

(Anyone else remember those details any better?)

HTH,

Mark S. Waterbury

> Terrence Enger wrote:
Hmm, this is a real memory test for me, but are you sure that RPG II had
the CABxx and CASxx opcodes? I only remember these from RPG III.

CVTRPGSRC, of course, does not claim to work for RPG II.

Cheers,
Terry.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.