Hi,
on the internet, I got to know that there's a Paragraph 'FUNCTION-ID'. I've seen something like 'ROUTINE-ID' for an option in a multiple choice question in a COBOL Quiz (option may be wrong too). But neither of them is a COBOL Keyword. I've searched a few COBOL books to find description only about intrinsic functions.
No COBOL manual speaks about User-defined functions, surprisingly.

Any functionality..
lets say, if I call that User-defined function like
C = FUNCTION ADD1 (A, B), it should throw no errors and C should have some value. If A and B are both numeric, C should be equal to A + B after the statement is run.

To do what you want, i'd suggest you create a common subroutine (funcadd) that is called dynamically (rather than statically).

The CALL would name 2 input fields, 1 output field, and 1 return-status. When invoked, the code would validate the 2 input numbers and if numeric, add them placing the total in the "output" field. Any problems would be noted in the return-status.

Thanks for the quick reply. Can you show me an example showing how we'll make use of the return-status, which I've never used before. How does the output variable come back to the main routine? is it a part of the argument list being called BY REFERENCE?

Can you show me an example showing how we'll make use of the return-status,

For example, a return-status of zero could mean the function completed successfully, a 1 could mean the first value was not numeric, a 2 if the second value was not numeric and so on for whatever situations need a return-status.

In the called code, there would be a LINKAGE SECTION that describes the 4 fields. In the calling code, 4 similar fields would be defined and used in the CALL:

Code:

CALL THE-FUNCTION USING FLD1, FLD2, THE-RESULT, RETURN-STATUS.

THE-FUNCTION is a working-storage field that contains the name of the called module.

Thanks Scherrer.
That was really informative.
How do I implement a function like this: C = FUNCTION MAX1 (A, B) for getting the maximum of A and B, instead of going for a default function, this way: C = FUNCTION MAX (A, B). 'MAX1 (Arg. list)' would be a function defined by me.

By adding more code to the called function, you could incorporate whatever options/functionality you wanted. If the code was to be made more general porpose, the called code would need to be provided with which operation to perform as part of the calling parameters (add, max, etc).

Thats true indeed, about CALLing a SUBROUTINE, but USER-DEFINED FUNCTIONS will never be CALLed using the CALL verb. In COBOL, can we create USER-DEFINED FUNCTIONS? to call them using the keyword FUNCTION..