Bill Klein wrote:
Although the '02 ANSI/ISO Standard does allow for "user-defined" functions,
these are NOT supported by current releases of IBM's Enterprise COBOL.
(Some vendors of Windows and Unix COBOL compilers do already support it).
On the other hand, ....
What do you mean by a "function"?
If you want to create a COBOL subprogram that takes in parameters and
RETURNS a value, then just look at the "Returning Phrase" of the Procedure
Division header. See:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr31/6.1.2.2
Although a COBOL program cannot use such a program as a function i.e.
FUNCTION user-name, it is quite possible that NON-COBOL applications can use
it.
If you are looking for something that can be used by a COBOL program, then
why do you need a FUNCTION instead of a subprogram?
"Carl Edwards" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
We have a need to write one or more FUNCTIONS in
COBOL, to date we have been unable to find any
reference to doing such. Does anyone know if this can
be one? Has anyone done it? Several members of the
staff say it can be doen, but are unable to show any
documentation on it.
TIA
Well, Bill's right, of course, in the sense that you can't
technically code COBOL functions; but you can code COBOL
programs that are function-like and that can be invoked as
functions from languages that use function references. You
just can't code function references in COBOL aside from
the built in intrinsic fucnctions.
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
z/OS Application development made easier
* Our classes include
+ How things work
+ Programming examples with realistic applications
+ Starter / skeleton code
+ Complete working programs
+ Useful utilities and subroutines
+ Tips and techniques
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html