• Subject: COBOL and RPG was Welcome new members
  • From: Howard Weatherly <hweatherly@xxxxxxxxxxxx>
  • Date: Thu, 02 Dec 1999 10:14:44 -0500

Jon, +-999,999,999,999,999,999 is a rather large number, unless we are talking 
about
how much money the government wastes....:-)

File erors are trapped by using Declaratives and yes the declarations can trap 
or do
anything!

You certainly can have duplicate names in multiple structures as long as you 
qualify
the name using the structure, the structure can ascend to the file name for file
data and to the 1 level for storage data. You can not have duplicate level 77 
items,
no way to qualify, you can have duplicate 1 levels as long as you provide
redefinition (although this is not very useful, there are times when 1 levels 
are
coppied as file records which are qualified to the file).
The corresponding is very useful for element extraction when you want to 
rearrange
data without writing a novel, and example is dates (move corr date1 to date2 
where
date1 is mmddyyyy and date2 is yyyymmdd) or if I dont want replication, (move 
corr
field1 to field2 where field1 has 10 fields A thru J and field 2 has every 
other of
A C E...).

While I am not sure what you mean by prototyping, I suspect you mean define it 
once
use it everywhere? Yes we can! (copy something replacing X by Y) and for
subprocedures? I do not know what you mean here, but whatever it is, it can be 
done!

Now let me say this about both COBOL and RPG, I like RPG when it is used for
reports, that is where it makes the most sense to me, I like the Cycle doing the
work and the ease with which reports can be modified. The fact that you may need
some calcs does not bother me either, I can also tolerate a forced read now and
agian and some file extensions for table processing, but once the line is 
crossed
(and this line is different for everyone) I find that RPG wil lose its ability 
to be
coherent (to me) whereas a well written COBOL program (the key word is "well
written") has the ability to allow me to understand the process(s) without being
familliar with the system. I can not do that with an RPG program, of course if 
maybe
I used RPG as much as I use COBOL, my tolerance line would shift probably.

Jon.Paris@halinfo.it wrote:

> For the most part I agree that there are still a number of features that are
> present in COBOL that RPG lacks.  As to your individual comments:
>
> - Indented code
>
> This is supported to a limited degree in D specs and C specs.  There will 
>likely
> be full support in C specs in the next RPG release.
>
> - long field names (and be able to use them in calcs)
>
> You mean 2056 characters isn't enough <grin>.  In practice I find the current
> (practical) limit of 14 to be more than adequate.  If I recall correctly the
> COBOL maximum is 30 but I never used them all. By contrast RPG supports 30 
>digit
> numerics while COBOL's default behavior is still 18. Now that _is_ a 
>limitation
> that I have hit.
>
> - record handling
>
> Not clear what you mean by this. By using RPGIV's externally described DS
> support together with the Prefix keyword I can handle things at the record
> level.
>
> - error trapping in free-format calcs (like EVAL x=y * z ON ERROR do something
> else)
>
> This has been "announced" by IBM in the form of the MONITOR group, which in 
>many
> ways is superior to COBOL's On error (which doesn't handle all errors by the
> way). They are considering the possibility of allowing this to be more 
>granular
> (a la COBOL) but MONITOR is probably better since in general I don't care if a
> single statement "blows" I want to know if anything goes wrong in a logically
> related group of statements.
>
> - data replication: move CORR to replicate data to fields of same name in 
>other
> records
>
> There has never been a need for this in absolute terms since you cannot have 
>two
> fields of the same name in different structures. I would love to see them do a
> similar thing though where the field prefix governed which fields were alike.
>
> - (and the converse: unlike RPG, dont replicate the data if the programmer
> doesnt want to!)
>
> You can already handle this with Prefix at the file level.
>
> The one biggie that COBOL is missing for me is prototyping of program calls 
>and
> the ability to define subprocedures. These have made a huge difference in my 
>RPG
> coding but I can't do it in COBOL.
>
> +---
> | This is the COBOL/400 Mailing List!
> | To submit a new message, send your mail to COBOL400-L@midrange.com.
> | To subscribe to this list send email to COBOL400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to COBOL400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---END

+---
| This is the COBOL/400 Mailing List!
| To submit a new message, send your mail to COBOL400-L@midrange.com.
| To subscribe to this list send email to COBOL400-L-SUB@midrange.com.
| To unsubscribe from this list send email to COBOL400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---END



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2021 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.