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

FUNCTION verb not working in COBOL for z/OS 3.4.1


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 03, 2009 4:53 pm
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 03, 2009 5:11 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Jun 03, 2009 8:24 pm
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 03, 2009 8:34 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top