Thread: COBOL

COBOL 6.4 user-defined functions - compile dies with 0C1

Started by Subrata • user4 replies269 viewsLast activity 1 month ago
Post #1
1 votes
Subrata
Reputation
41
Posts: 3
Joined: Feb 14, 2025, 10:08 AM
Posted: May 28, 2026, 8:25 AM

Pardon the basic question. Infra rolled out COBOL 6.4 last month and I am trying the user-defined function samples from the IBM docs. My understanding was: write the function in one compilation unit, main program in another, call it like a subprogram but with FUNCTION syntax.

Compilation itself is failing. Compiler does not seem to recognize FUNCTION at all and we get a 0C1 during compile step. Docs look clear on paper. Anyone actually got UDF working in a real shop? Is there a PTF or compiler option we missed?

Post #2
1 votes
Marty
Reputation
412
Posts: 15
Joined: Aug 12, 2024, 9:14 AM
Posted: May 28, 2026, 12:25 PM

Check you are on the right compiler maintenance and that FUNCTION ALL INTRINSIC is not fighting your UDF setup. Also confirm the function source is in a separate compile with the right repository paragraph. IBM has a few sample JCLs that use IGYWCL with an explicit entry point.

Post #3
1 votes
Subrata
Reputation
41
Posts: 3
Joined: Feb 14, 2025, 10:08 AM
Posted: May 30, 2026, 11:25 AM

Update: open ticket with IBM. Turns out our compile proc was still pointing at an older SYSLIB chain. Fixed that and the sample compiles. Still working through linkage on our own function.

Post #4
0 votes
Priya
Reputation
56
Posts: 8
Joined: Aug 17, 2025, 2:03 PM
Posted: May 31, 2026, 2:25 PM

Good to know it was not just me. Same confusion reading the manual.

You must be signed in to reply to this thread