Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FUNCTION verb not working in COBOL for z/OS 3.4.1

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
foliater

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Wed Jun 03, 2009 4:36 pm    Post subject: FUNCTION verb not working in COBOL for z/OS 3.4.1
Reply with quote

Hi -

I am using IBM Enterprise COBOL for z/OS 3.4.1
This will be upgraded shortly to IBM Enterprise COBOL for z/OS 4.1

Rightnow FUNCTION verb is not working for me.

I tried the below.
FUNCTION CURRENT-DATE


What version of COBOL should I have for this verb to work? Will it work after the upgrade to 4.1
Is it something which needs to be installed?
Is there a way to know the COBOL year of release I am using? Eg: 74,85,2002 and so on...
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 03, 2009 4:53 pm    Post subject: Reply to: FUNCTION verb
Reply with quote

Use this site's SEARCH facility for CURRENT-DATE. You'll get many hits, one (or more) of which should give you your answer.

INTRINSIC FUNCTIONS were introduced with COBOL/370, some 15-18+ years ago and are upward compatible to the latest version/release of COBOL.

OS/VS COBOL and VS/COBOL II did not support INTRINSIC FUNCTIONS.

Have you reviewed the IBM manuals (see top of main page for links).
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jun 03, 2009 5:11 pm    Post subject:
Reply with quote

Quote:
Rightnow FUNCTION verb is not working for me.

I tried the below.
FUNCTION CURRENT-DATE
There's nothing like giving us completely useless information. If you had given us the full COBOL statement you used that would be useful. Without context, for all we know you coded that in the WORKING-STORAGE and of course that will generate a compile error.

Further, saying "is not working for me" does not tell us if you're getting a compile error on the statement, or your compile is working but you are not getting expected results while running, or if you're getting an abend on the code -- again, your statement is totally useless as far as getting help since you don't provide any details or context.
Back to top
View user's profile Send private message
foliater

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Wed Jun 03, 2009 7:08 pm    Post subject:
Reply with quote

icon_smile.gif

My code would look like below exactly

MOVE FUNCTION CURRENT-DATE TO WS-CURRENT-DATE.

The function verb started working now.The COBOL version upgrade is complete I guess.

I just liked to understand, in which version or year of release FUNCTION verb is available. I am not an expert in this so my question might be amatuerish. I also dont know to find the year of release of COBOL I am using

I got a compile error saying FUNCTION not found or something similar to that yesterday. The same code worked today.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 03, 2009 8:24 pm    Post subject:
Reply with quote

Hello,

Quote:
The function verb started working now.The COBOL version upgrade is complete I guess.
Probably has nothing to do with any upgrade. . . Your posted statement works correctly with this compiler:
Code:
PP 5655-G53 IBM ENTERPRISE COBOL FOR Z/OS  3.4.1


You have changed the code. If you return the code to the code that fails, you will be able to see the error message again.

There is no "FUNCTION verb", but functions have been available in cobol for many years (Bill mentions more than 15).

Quote:
I also dont know to find the year of release of COBOL I am using
There is probably no reason to do so. The year a compiler was released should have no bearing on the code you work with. You simply have to use the compiler that the organization has chosen.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jun 03, 2009 8:34 pm    Post subject:
Reply with quote

I'm perfectly comfortable with amateurish questions -- there's plenty of those every day. However, if you don't provide context, that's not amateurish -- that's either sloppy or deliberately hiding necessary data. And it's not amateurish to post a question easily answered in the manual -- that's just lazy; if somebody can't be bothered to look in the manuals that are easily accessed from this page, why should we?

Enterprise COBOL 3.4.1 supports FUNCTION CURRENT-DATE, so if your code didn't work one day and works now, you changed something to make it work since a syntactically correct statement would have compiled in the first place.

Quote:
I got a compile error saying FUNCTION not found or something similar to that yesterday
If you had the exact error message, with the identifier number from the front of it, we could do much more to tell you what happened and how you fixed it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us