On 2012-05-01, at 1:00 PM, midrange-l-request@xxxxxxxxxxxx wrote:

Does COBOL/400 or COBOL /ILE support user-defined functions in any fashion (like RPG and all other modern languages)?

No - not currently to the best of my knowledge.

For example,

Move DayOfWeek(Date-input) to print-line

Where DayOfWeek is a user-defined function returning "Monday" or "Tuesday" or etc.

If not, why not?

There is the notion of User Defined functions in the ANSI 2002 standard but as of 2010 IBM had not implemented it even on the mainframe. Don't know if it has happened since.

Why not? Most seem happy to just use a CALL interface and the IBM i COBOL supports return values.

It used to be that ANSI compliance was essential to be able to bid on government contracts but that requirement seems to have evaporated. With that it became more a question of business justification.

And any more discussion should be on the COBOL list or "He who must be obeyed" will descend upon our heads.

Jon Paris


This thread ...


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

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