IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL 6.4 - User Defined Function need some idea


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 130
Location: Bangalore

PostPosted: Sun May 19, 2024 5:33 am
Reply with quote

Hi Team,

Pardon my ignorance, I have very little idea about COBOL's User Defined Function feature which was introduced by IBM in 6.4 version of COBOL.

In my shop, Infra-team recently installed the COBOL 6.4 version, and want to know about this User Defined Function. Does anyone know about it or has already implemented or tested it? If Yes, then if you can share a small example of the setup then it would be great.. I have checked the IBM documentation but it's not very clear to me. so looking for someone who already tested it.

My understanding is, that I can write a small function code in a stand-alone compilation unit and then write another main module (as a separate compilation unit) and call the function from there... kind of same like we call sub-programs dynamically in COBOL. But I may be wrong..

So need some idea..

Thanks,
Subrata
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sun May 19, 2024 5:45 am
Reply with quote

googling with cobol user defined functions
returned 2 links

www.ibm.com/docs/en/cobol-zos/6.4?topic=applications-using-user-defined-functions

www.ibm.com/docs/en/cobol-zos/6.4?topic=structure-cobol-user-defined-function-definition

the documentation seemed pretty clear to me icon_cool.gif
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 130
Location: Bangalore

PostPosted: Mon May 20, 2024 6:10 pm
Reply with quote

Hi Enrico,

Thanks for your reply. Yes I checking those 2 links and tried with IBM shown examples also. Something is not right (Obviously at my end) and compilation itself is failing (when I am trying to compile the Function modules separately).

I will try again and will see. If I fail, I will come back to the same thread with all the details..

Thanks
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 130
Location: Bangalore

PostPosted: Wed May 29, 2024 4:50 am
Reply with quote

Update...

I tried to compile and run IBM-given sample examples. Seems the compilation itself is failing. From what I saw, the compiler is not able to recognize the FUNCTION keyword (Though we have now COBOL 6.4). I am Getting SOC1 abend.

In discussion with the support team to identify the issue. Not sure if any special compiler option or setup needs to be done.

Thanks
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Wed May 29, 2024 7:25 am
Reply with quote

re: I am Getting SOC1 abend

Can you clarify? Is the compiler getting 0C1 or are you trying to run the program anyway after the compile failed?
Back to top
View user's profile Send private message
subratarec

Active User


Joined: 22 Dec 2007
Posts: 130
Location: Bangalore

PostPosted: Thu May 30, 2024 9:05 am
Reply with quote

Hi Pedro,

Is the compiler getting 0C1 - This is correct. Weird but it is happening. So I gave the post. Because it is new to me (user-defined function) I wanted to get someone's experience if they have already used it.

Still working with the IT team on this. The basic compilation itself is not happening.

Thanks
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Thu May 30, 2024 9:31 pm
Reply with quote

subratarec wrote:

Is the compiler getting 0C1 - This is correct. Weird but it is happening.

Highly likely, the input dataset with the source code has wrong format?
Any other wrong DD statement may give such result, too.

It is a very bad idea - to start here a theoretical research: what might happen?
Please, present here THE FULL CODE (JCL compile, or whatever) which has failed, plus ALL AVAILABLE LOGS AND MESSAGES.

Did you try to start your compilation from a simple "HELLO, WORLD!" program?!
After that, you can start adding real parts of your code, one by one, until "your compilation fails again" icon_redface.gif

P.S.
Do not forget to use the Code button to emphasize your code!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts System add a USER parm when job submi... TSO/ISPF 4
No new posts Compile Sp Cobol base COBOL Programming 1
Search our Forums:

Back to Top