Many years ago I have seen cobol output generated by such a converter
which
looked terrible. I would refuse any request to debug or change such a
generator output.
The only way was to continue development and debugging in RPG and then
convert to cobol. btw, the conversion was from RPGII for /36 to Cobol
for /36.
Peter
If you need more Info contact: a...@techno-soft.de
Arnim Karberg
Peter Neidhart schrieb in Nachricht <3562B3A9...@debis.de>...
Luctor is an new converter written in Ansi-C.
We have developed that converter al the time of the
migration process.
3.800 programms; it was a absolutly must that we
must have a 100 % convertion. Not 90 or 95 %!
If there manualy work nessesary, it was not able
to make that migration.
Assumed 1 Day per Programm --> 3.800 Days.
Additionally, a quite other test-quality lasts
necessarily, if reworked programs manually
would have had to become.
Its a realy great tool.
Best regards
Arnim Karberg
a...@techno-soft.de
Robert Moriarty schrieb in Nachricht <35630204...@ms.com>...
AIUI the RPG to COBOL product was intended to target Small, Medium (V
Series), and Large (A Series). There weren't enough customers to
justify making it work on Large, and there was so much demand for RPG on
Small that they wrote an RPG compiler which was prefered over the
translator, so it was only used on Medium systems. But the translator
was always a little buggy, it's output was ugly and it was difficult to
maintain for new dialects of RPG, so it was scrapped in favor of RPG
compilers for Medium and Large (I don't recall of RPG for Medium ever
shipped). The translator may have been named COFRS, but it was dead
before I worked for Burroughs.
Having worked on the A Series RPG compiler, I can tell two important
truths about RPG:
1) RPG is the hardest language to write a compiler for.
2) When writing an RPG to anything else translator, #1 applies.
#1 may be a surprise to many, because RPG is so easy to parse. But
parsing is a well developed art, what's different about RPG is the fixed
logic cycle. An RPG-to-whatever translator must generate the RPG
cycle. The generated code is impossible to modify, unless the
programmer is intimately familiar with the implementation of the RPG
cycle. The filter can be somewhat user friendly -- generated paragraph
names like CYCLE-L2-TOTALS are prefered over QQQ3983 -- but the
generated code is at best very hard to maintain.
--
I |\ Randall Bart
L |/ mailto:Bart...@usa.spam.net Bart...@att.spam.net
o |\ 1-310-542-6013 Please reply without spam
v | \
e |\ Californians: Vote June 2nd Dennis PERON for Governor
Y |/ John PINKERTON For Senator Bill LOCKYER for Attorney General
o |\ Panic in the Year Zero Zero: http://members.aol.com/PanicYr00
u |/ Is it easy yet?:http://members.aol.com/PanicYr00/Sequence.html
------------------------------------------------------------------------
Well well.....
On the contrary to popular believe it is very well possible to convert
from RPGII/III to some flavour of COBOL-85 and to produce a readable
COBOL program as well.
Yes, there were/are a lot of RPG-converters that promise much and leave
a bad smell.
We can have a long discussion about being able to read something.
Not so interesting.
Just look at this very small and arbitrary RPG-II program that was
converted to MicroFocus Cobol for UNIX. This program is deliberatedly
small just to give an impression.
A bit of code says more than a lot of words.
The Luctor converter handles quite a lot. It preserves comment-lines,
record-structures and produces very well sectioned code. Practically all
RPG stuff like Matching, Control-breaks, ... is supported. AS/400 full
procedural files are handled as well. (Including the DDS stuff(A-cards))
Ok, i know that you can rewrite such a small RPG-program in Cobol in
just one hour. Don't even think on rewriting a real RPG-program of any
real size. You will fail! This converter wont.
RPG01-code:
H
J RPG01
FFILEA IP F92161024 4AI 5 DISK
FFILEB O F 640 64 DISK
IFILEA NS 01 3 CZ
I 9 120ORDNR
I 5 80PAYNR
I 49 68 PNAME
I 31 360RES
I 37 420RESR2
I NS 99
C 99 GOTO SKIP
C PAYNR COMP 1456 02
C 02 GOTO SKIP
C ORDNR COMP 1256 02
C 02 GOTO SKIP
C PAYNR COMP 1840 02
C 02 GOTO SKIP
C SETON 81
C 81 EXCPT
C SETOF 81
C SKIP TAG
OFILEB E 81
O PAYNR 4
O PNAME 24
O RES 34
O RESR2 40
Generated Cobol-code:
$SET ASSIGN(EXTERNAL)
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. RPG01.
000030 AUTHOR. LUCTOR RPG-II TO MF-COBOL CONVERTER.
000040** VERSION: LU-980504.
000050** CONVERSION MODE WAS COBOL-LIKE.
000060** NUMERIC FIELDS AS SIGNED.
000070 DATE-WRITTEN. 24-05-98.
000080 ENVIRONMENT DIVISION.
000090 CONFIGURATION SECTION.
000100 SOURCE-COMPUTER. UNIX.
000110 OBJECT-COMPUTER. UNIX.
000120 SPECIAL-NAMES.
000130 CONSOLE IS SCREEN-IN
000140 SYSOUT IS SCREEN-OUT
000150 SWITCH-0 IS INDU1-EXT
000160 ON STATUS IS INDU1-EXT-ON
000170 SWITCH-1 IS INDU2-EXT
000180 ON STATUS IS INDU2-EXT-ON
000190 SWITCH-2 IS INDU3-EXT
000200 ON STATUS IS INDU3-EXT-ON
000210 SWITCH-3 IS INDU4-EXT
000220 ON STATUS IS INDU4-EXT-ON
000230 SWITCH-4 IS INDU5-EXT
000240 ON STATUS IS INDU5-EXT-ON
000250 SWITCH-5 IS INDU6-EXT
000260 ON STATUS IS INDU6-EXT-ON
000270 SWITCH-6 IS INDU7-EXT
000280 ON STATUS IS INDU7-EXT-ON
000290 SWITCH-7 IS INDU8-EXT
000300 ON STATUS IS INDU8-EXT-ON
000310 DECIMAL-POINT IS COMMA.
000380***************************
000390 INPUT-OUTPUT SECTION.
000400 FILE-CONTROL.
000410 SELECT FILEA-FIL ASSIGN TO "FILEA"
000420 FILE STATUS IS FILEA-STAT
000430 ORGANIZATION IS INDEXED
000440 ACCESS MODE IS DYNAMIC
000450 RECORD KEY IS FILEA-KEY-1.
000460 SELECT FILEB-FIL ASSIGN TO "FILEB"
000470 FILE STATUS IS FILEB-STAT
000480 ORGANIZATION IS SEQUENTIAL
000490 ACCESS MODE IS SEQUENTIAL.
000500 DATA DIVISION.
000510 FILE SECTION.
000520 FD FILEA-FIL
000530 LABEL RECORDS ARE OMITTED.
000540 01 FILEA-REC.
000550 03 FILEA-WRK.
000560 05 FILLER PIC X(4).
000570 05 FILEA-KEY-1 PIC X(4).
000580 05 PAYNR-WRK-RED1 REDEFINES FILEA-KEY-1.
000590 07 PAYNR-WRK PIC S9(4).
000600 05 ORDNR-WRK PIC S9(4).
000610 05 FILLER PIC X(18).
000620 05 RES-WRK PIC S9(6).
000630 05 RESR2-WRK PIC S9(6).
000640 05 FILLER PIC X(6).
000650 05 PNAME-WRK PIC X(20).
000660 05 FILLER PIC X(956).
000670 FD FILEB-FIL
000680 LABEL RECORDS ARE STANDARD.
000690 01 FILEB-REC.
000700 05 FILLER PIC X(64).
000710 WORKING-STORAGE SECTION.
000720 01 INDICATORS. COPY INDMOD.
000730 01 G-KEY PIC X VALUE "G".
000740 01 SETK-KEY PIC 9(5) BINARY VALUE 1.
000750 01 ERRORFILE PIC X(8) VALUE SPACES.
000760 01 ERRORCMD PIC X(8) VALUE SPACES.
000770 01 ERRORSTAT PIC X(2) VALUE ZERO.
000780 01 LEFTOVER PIC 9(18) BINARY VALUE 0.
000790 01 TABCOUNT PIC 9(8) BINARY.
000800 01 BITXX-FIELD PIC X(8).
000810 01 RECFORMNUM PIC 9(4) BINARY.
000820 01 FORMNUMSAVE PIC 9(4) BINARY.
000830 01 CONVERSION-FLD PIC S9(18) VALUE ZERO.
000840 01 FIRST-PASS-SW PIC 9 VALUE 1.
000850 88 FIRST-PASS VALUE 1.
000860 01 READCMD-SW PIC 9 VALUE 0.
000870 88 READCMD VALUE 1.
000880 01 CNTRL-BRK-SW PIC 9 VALUE 0.
000890 88 CONTROL-BREAK VALUE 1.
000900 01 SFS-MASK PIC X(10) VALUE SPACES.
000910 01 UPSI-BYTE.
000920 05 INDU1 PIC 9 VALUE 0.
000930 88 INDU1-ON VALUE 1.
000940 88 INDU1-OFF VALUE 0.
000950 05 INDU2 PIC 9 VALUE 0.
000960 88 INDU2-ON VALUE 1.
000970 88 INDU2-OFF VALUE 0.
000980 05 INDU3 PIC 9 VALUE 0.
000990 88 INDU3-ON VALUE 1.
001000 88 INDU3-OFF VALUE 0.
001010 05 INDU4 PIC 9 VALUE 0.
001020 88 INDU4-ON VALUE 1.
001030 88 INDU4-OFF VALUE 0.
001040 05 INDU5 PIC 9 VALUE 0.
001050 88 INDU5-ON VALUE 1.
001060 88 INDU5-OFF VALUE 0.
001070 05 INDU6 PIC 9 VALUE 0.
001080 88 INDU6-ON VALUE 1.
001090 88 INDU6-OFF VALUE 0.
001100 05 INDU7 PIC 9 VALUE 0.
001110 88 INDU7-ON VALUE 1.
001120 88 INDU7-OFF VALUE 0.
001130 05 INDU8 PIC 9 VALUE 0.
001140 88 INDU8-ON VALUE 1.
001150 88 INDU8-OFF VALUE 0.
001160 01 ITER-LEAVE-SW PIC 9 VALUE 0.
001170 88 LEAVE-OR-ITER VALUES 1, 2.
001180 88 ITER-NOW VALUE 1.
001190 88 LEAVE-NOW VALUE 2.
001200 01 FILEA-LR-SW PIC 9 VALUE 0.
001210 88 FILEA-LR VALUE 1.
001220 88 FILEA-DONE VALUE 2.
001230 01 FILEA-FR-SW PIC 9 VALUE 1.
001240 88 FILEA-FR VALUE 1.
001250 01 FILEA-STAT.
001260 03 FILEA-STAT-1 PIC 9 VALUE ZERO.
001270 88 FILEA-STAT-OK VALUE 0.
001280 03 FILEA-STAT-2 PIC X VALUE ZERO.
001290 01 FILEA-OPEN-SW PIC 9 VALUE 0.
001300 88 FILEA-OPEN VALUE 1.
001310 01 FILEB-LR-SW PIC 9 VALUE 0.
001320 88 FILEB-LR VALUE 1.
001330 88 FILEB-DONE VALUE 2.
001340 01 FILEB-FR-SW PIC 9 VALUE 1.
001350 88 FILEB-FR VALUE 1.
001360 01 FILEB-STAT.
001370 03 FILEB-STAT-1 PIC 9 VALUE ZERO.
001380 88 FILEB-STAT-OK VALUE 0.
001390 03 FILEB-STAT-2 PIC X VALUE ZERO.
001400 01 FILEB-OPEN-SW PIC 9 VALUE 0.
001410 88 FILEB-OPEN VALUE 1.
001420 01 FILEA-CUR.
001430 03 FILEA-CURREC.
001440 05 FILLER PIC X(4).
001450 05 FILEA-KEY-1-CUR PIC X(4).
001460 05 PAYNR-RED1 REDEFINES FILEA-KEY-1-CUR.
001470 07 PAYNR PIC S9(4).
001480 05 ORDNR PIC S9(4).
001490 05 FILLER PIC X(18).
001500 05 RES PIC S9(6).
001510 05 RESR2 PIC S9(6).
001520 05 FILLER PIC X(6).
001530 05 PNAME PIC X(20).
001540 05 FILLER PIC X(956).
001550 01 FILEA-HOLD.
001560 03 FILEA-HLD.
001570 05 FILLER PIC X(4).
001580 05 FILEA-KEY-1-HOLD PIC X(4).
001590 05 PAYNR-HOLD-RED1 REDEFINES FILEA-KEY-1-HOLD.
001600 07 PAYNR-HOLD PIC S9(4).
001610 05 ORDNR-HOLD PIC S9(4).
001620 05 FILLER PIC X(18).
001630 05 RES-HOLD PIC S9(6).
001640 05 RESR2-HOLD PIC S9(6).
001650 05 FILLER PIC X(6).
001660 05 PNAME-HOLD PIC X(20).
001670 05 FILLER PIC X(956).
001680 01 SELECT-MODE PIC X VALUE "A".
001690 01 FSELECT-TAB.
001700 03 FSEL-ELEMENT OCCURS 2 TIMES.
001710 05 MMSGROUP.
001720 07 SELSEQU PIC 9(2).
001730 05 FILENAME PIC X(8).
001740 01 FTELLER PIC 9(6) BINARY.
001750***************************
001760 PROCEDURE DIVISION.
001770 MAIN SECTION.
001780 MAIN-01.
001790 PERFORM UPSITEST.
001800 PERFORM RPG-OPEN.
001810 PERFORM INITALL.
001820 MAIN-02.
001830 PERFORM RPG-CYCLE UNTIL INDLR-ON OR INDH0-ON
001840 OR INDH1-ON OR INDH2-ON OR INDH3-ON
001850 OR INDH4-ON OR INDH5-ON OR INDH6-ON
001860 OR INDH7-ON OR INDH8-ON OR INDH9-ON.
001870 MAIN-99.
001880 PERFORM RPG-CLOSE.
001890 DISPLAY 'PROGRAM :RPG01 TERMINATED NORMALLY'.
001900 STOP RUN RETURNING 0.
001910***************************
001920 RPG-CYCLE SECTION.
001930 RPG-CYCLE-01.
001940 PERFORM RPG-HEADER-OUT.
001950 INITIALIZE OVERFLOW-INDICATORS.
001960 PERFORM RPG-DETAIL-OUT.
001970 PERFORM RPG-INPUT.
001980 RPG-CYCLE-02.
001990 IF INDLR-ON
002000 PERFORM RPG-TOTAL-CALC
002010 PERFORM RPG-TOTAL-OUT
002020 GO TO RPG-CYCLE-99.
002030 PERFORM RPG-DETAIL-CALC.
002040 IF INDLR-ON GO TO RPG-CYCLE-02.
002050 RPG-CYCLE-99.
002060 EXIT.
002070***************************
002080 INITALL SECTION.
002090 INITALL-01.
002100 INITIALIZE IND01-99.
002110 INITIALIZE CONTROL-BREAKS.
002120 MOVE 1 TO INDL0.
002130 INITIALIZE MATCHING-INDICATORS.
002140 INITIALIZE CHAINING-INDICATORS.
002150 INITIALIZE HALT-INDICATORS.
002160 INITIALIZE OVERFLOW-INDICATORS.
002170 INITIALIZE SPECIALS.
002180 MOVE ZERO TO LEFTOVER.
002190 MOVE ZERO TO READCMD-SW.
002200 MOVE ZERO TO CNTRL-BRK-SW.
002210 ACCEPT UDATE FROM DATE.
002220 MOVE UDATE(5:2) TO UDAY.
002230 MOVE UDATE(1:2) TO UDATE(5:2).
002240 MOVE UDAY TO UDATE(1:2).
002250 MOVE UDATE(3:2) TO UMONTH.
002260 MOVE UDATE(5:2) TO UYEAR.
002270 MOVE UDATE TO DQTE.
002280 MOVE 1 TO IND1P.
002290 PERFORM RPG-HEADER-OUT.
002300 PERFORM RPG-DETAIL-OUT.
002310 MOVE 0 TO IND1P.
002320 MOVE "FILEA" TO RPG-FILENAME.
002330 MOVE 0 TO FIRST-PASS-SW.
002340 INITALL-99.
002350 EXIT.
002360***************************
002370 UPSITEST SECTION.
002380 UPSITEST-01.
002390 IF INDU1-EXT-ON
002400 MOVE 1 TO INDU1.
002410 IF INDU2-EXT-ON
002420 MOVE 1 TO INDU2.
002430 IF INDU3-EXT-ON
002440 MOVE 1 TO INDU3.
002450 IF INDU4-EXT-ON
002460 MOVE 1 TO INDU4.
002470 IF INDU5-EXT-ON
002480 MOVE 1 TO INDU5.
002490 IF INDU6-EXT-ON
002500 MOVE 1 TO INDU6.
002510 IF INDU7-EXT-ON
002520 MOVE 1 TO INDU7.
002530 IF INDU8-EXT-ON
002540 MOVE 1 TO INDU8.
002550 UPSITEST-99.
002560 EXIT.
002570***************************
002580 RPG-TOTAL-CALC SECTION.
002590 RPG-TOTAL-01.
002600 RPG-TOTAL-99.
002610 EXIT.
002620***************************
002630 RPG-INPUT SECTION.
002640 RPG-INPUT-01.
002650 MOVE ZERO TO READCMD-SW.
002660 MOVE 0 TO IND01 IND99.
002670 RPG-INPUT-02.
002680 IF FILEA-OPEN AND FILEA-DONE
002690 MOVE 0 TO FILEA-LR-SW
002700 READ FILEA-FIL NEXT INTO FILEA-HOLD
002710 AT END MOVE 1 TO FILEA-LR-SW.
002720 RPG-INPUT-03.
002730 IF RPG-FILENAME = "FILEA"
002740 PERFORM FILEA-READ ELSE
002750 DISPLAY 'PROGRAM :RPG01 TERMINATING ABNORMALLY.'
002760 DISPLAY 'INVALID FILE_NAME SELECTED!'
002770 DISPLAY RPG-FILENAME
002780 MOVE 1 TO INDU1, INDU2
002790 PERFORM RPG-CLOSE
002800 STOP RUN RETURNING 1.
002810 RPG-INPUT-04.
002820 IF FILEA-LR
002830 MOVE 1 TO INDLR
002840 MOVE ALL '1' TO CONTROL-BREAKS
002850 ELSE
002860 MOVE 0 TO INDLR.
002870 RPG-INPUT-99.
002880 EXIT.
002890***************************
002900 RPG-OPEN SECTION.
002910 RPG-OPEN-01.
002920 OPEN INPUT FILEA-FIL.
002930 IF FILEA-STAT-OK
002940 MOVE 1 TO FILEA-OPEN-SW
002950 ELSE
002960 DISPLAY "***** PROGRAM :RPG01 *****"
002970 DISPLAY "***** PRIMARY FILE DID NOT OPEN *****"
002980 DISPLAY "**ERROR** File: FILEA Code: ", FILEA-STAT
002990 MOVE 1 TO INDU1, INDU2
003000 PERFORM RPG-CLOSE
003010 STOP RUN RETURNING 1.
003020 MOVE 2 TO FILEA-LR-SW.
003030 OPEN OUTPUT FILEB-FIL.
003040 IF FILEB-STAT-OK
003050 MOVE 1 TO FILEB-OPEN-SW
003060 ELSE
003070 DISPLAY "***** PROGRAM :RPG01 ****"
003080 DISPLAY "**ERROR** File: FILEB Code: ", FILEB-STAT
003090 MOVE 1 TO INDU1, INDU2
003100 PERFORM RPG-CLOSE
003110 STOP RUN RETURNING 1.
003120 RPG-OPEN-99.
003130 EXIT.
003140***************************
003150 RPG-CLOSE SECTION.
003160 RPG-CLOSE-01.
003170 IF INDU1-ON
003180 SET INDU1-EXT TO ON.
003190 IF INDU2-ON
003200 SET INDU2-EXT TO ON.
003210 IF INDU3-ON
003220 SET INDU3-EXT TO ON.
003230 IF INDU4-ON
003240 SET INDU4-EXT TO ON.
003250 IF INDU5-ON
003260 SET INDU5-EXT TO ON.
003270 IF INDU6-ON
003280 SET INDU6-EXT TO ON.
003290 IF INDU7-ON
003300 SET INDU7-EXT TO ON.
003310 IF INDU8-ON
003320 SET INDU8-EXT TO ON.
003330 CLOSE FILEA-FIL.
003340 CLOSE FILEB-FIL.
003350 RPG-CLOSE-99.
003360 EXIT.
003370***************************
003380 RPG-DETAIL-CALC SECTION.
003390 RPG-DETAIL-01.
003400 IF ( IND99-ON )
003410 GO TO SKIP-PAR.
003420 MOVE ZERO TO IND02
003430 IF PAYNR LESS THAN 1456
003440 MOVE 1 TO IND02.
003450 IF ( IND02-ON )
003460 GO TO SKIP-PAR.
003470 MOVE ZERO TO IND02
003480 IF ORDNR GREATER THAN 1256
003490 MOVE 1 TO IND02.
003500 IF ( IND02-ON )
003510 GO TO SKIP-PAR.
003520 MOVE ZERO TO IND02
003530 IF PAYNR EQUAL 1840
003540 MOVE 1 TO IND02.
003550 IF ( IND02-ON )
003560 GO TO SKIP-PAR.
003570 MOVE 1 TO IND81.
003580 IF ( IND81-ON )
003590 PERFORM EXCPT.
003600 MOVE 0 TO IND81.
003610 SKIP-PAR.
003620 RPG-DETAIL-99.
003630 EXIT.
003640***************************
003650 RPG-DETAIL-OUT SECTION.
003660 RPG-DETAIL-OUT-01.
003670 MOVE ZERO TO LEFTOVER.
003680 RPG-DETAIL-OUT-99.
003690 EXIT.
003700***************************
003710 EXCPT SECTION.
003720 EXCPT-01.
003730 FILEB-EXCEPT-1.
003740 MOVE SPACES TO FILEB-REC.
003750 IF ( IND81-ON )
003760 MOVE PAYNR(1:4) TO FILEB-REC(1:4)
003770 MOVE PNAME TO FILEB-REC(5:20)
003780 MOVE RES(1:6) TO FILEB-REC(29:6)
003790 MOVE RESR2(1:6) TO FILEB-REC(35:6)
003800 END-IF
003810 IF ( IND81-ON )
003820 AND FILEB-OPEN
003830 WRITE FILEB-REC.
003840 EXCPT-98.
003850 MOVE 1 TO INDL0.
003860 EXCPT-99.
003870 EXIT.
003880***************************
003890 RPG-HEADER-OUT SECTION.
003900 RPG-HEADER-OUT-01.
003910 MOVE ZERO TO LEFTOVER.
003920 RPG-HEADER-OUT-99.
003930 EXIT.
003940***************************
003950 RPG-TOTAL-OUT SECTION.
003960 RPG-TOTAL-OUT-01.
003970 MOVE ZERO TO LEFTOVER.
003980 RPG-TOTAL-OUT-99.
003990 EXIT.
004000***************************
004010***************************
004020 FILEA-READ SECTION.
004030 FILEA-READ-01.
004040 IF NOT READCMD
004050 INITIALIZE CONTROL-BREAKS.
004060 IF NOT FILEA-LR AND FILEA-OPEN
004070 MOVE 2 TO FILEA-LR-SW.
004080 IF FILEA-LR OR NOT FILEA-OPEN
004090 MOVE "FILEA" TO RPG-FILENAME
004100 MOVE ALL "1" TO CONTROL-BREAKS
004110 GO TO FILEA-READ-99.
004120 FILEA-READ-02.
004130 IF FILEA-HOLD(3:1) = "Z"
004140 MOVE 1 TO RECFORMNUM
004150 MOVE 1 TO IND01 ELSE
004160 MOVE 2 TO RECFORMNUM
004170 MOVE 1 TO IND99.
004180 FILEA-READ-03.
004190 MOVE FILEA-HOLD TO FILEA-CUR.
004200 FILEA-READ-04.
004210 MOVE 0 TO INDMR.
004220 FILEA-READ-05.
004230 FILEA-READ-06.
004240 FILEA-READ-07.
004250 MOVE "FILEA" TO RPG-CURFILE.
004260 FILEA-READ-99.
004270 EXIT.
> Well well.....
> On the contrary to popular believe it is very well possible to convert
> from RPGII/III to some flavour of COBOL-85 and to produce a readable
> COBOL program as well.
> Yes, there were/are a lot of RPG-converters that promise much and leave
> a bad smell.
> We can have a long discussion about being able to read something.
> Not so interesting.
> Just look at this very small and arbitrary RPG-II program that was
> converted to MicroFocus Cobol for UNIX. This program is deliberatedly
> small just to give an impression.
> A bit of code says more than a lot of words.
> The Luctor converter handles quite a lot. It preserves comment-lines,
> record-structures and produces very well sectioned code. Practically all
> RPG stuff like Matching, Control-breaks, ... is supported. AS/400 full
> procedural files are handled as well. (Including the DDS stuff(A-cards))
>
> Ok, i know that you can rewrite such a small RPG-program in Cobol in
> just one hour. Don't even think on rewriting a real RPG-program of any
> real size. You will fail! This converter wont.
>
> RPG01-code:
<snip>
Your program does produce beautiful code, but let me point out a few
things:
Your RPG program is 26 lines.
The generated Cobol program is 427 lines.
Your RPG program doesn't use any Lx or Mx indicators.
Thus your translator added 400 lines to the program, and you're dealing
with the simplest example of the RPG fixed logic cycle. A more complex
RPG program will generate a more complex Cobol porgram. I'm not saying
that such a program will be unmodifiable, but it will not be modifiable
by a typical Cobol programmer. Any programmer who modifies that
generated code *must* understand the RPG cycle (and your implementation
of it) to be able to modify the program.
> 002220 MOVE UDATE(5:2) TO UDAY.
> 002230 MOVE UDATE(1:2) TO UDATE(5:2).
> 002240 MOVE UDAY TO UDATE(1:2).
> 002250 MOVE UDATE(3:2) TO UMONTH.
> 002260 MOVE UDATE(5:2) TO UYEAR.
A translator that is claiming it produces readable, modifiable code
should always generate the apropriate sub-fields rather than using
reference modification.
>Your RPG program is 26 lines.
>The generated Cobol program is 427 lines.
>Your RPG program doesn't use any Lx or Mx indicators.
The developpers of the translator didn't go very far in optimizing the
COBOL code: the program doesn't use UPSI indicators, but the translator
generates 80 lines of code to handle them.
Also, the RPG cycle can be simplified quite a bit when there's only one
input file, as is the case in this example.
g...@ibm.net (Gilbert Saint-flour)
Automated Migrations Services
http://members.home.net/gsf
Gilbert Saint-flour wrote in message
<3569c39e$1$tfs$mr2...@news-s01.ny.us.ibm.net>...
[My contribution to that project was simpler, I had to patch the A-Series'
RPG compiler to do what was expected and written in the manuals and to write
sort of DCILIBRARY for adapting the communication]
/Klaus
Wolfgang Grossbauer wrote in message <6kemt2$1a3$1...@news.Austria.EU.net>...
One other option that I have worked with would be to convert on a 2200
or ClearPath IX with the RPGCOB product. It also (and quite necessarily
so!!) faitfully reproduces the RPG processing cycle. Resultant code is
thus only meaningfull to Ex RPG programmers.
Regards,
Aart Smits
ASB, Aart Smits Beratung
Phone: +41-61-4010368 Fax: +41-61-4010327 E-mail: sm...@bluewin.ch