View previous topic :: View next topic
|
Author |
Message |
foliater
New User
Joined: 06 Apr 2006 Posts: 31
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
foliater
New User
Joined: 06 Apr 2006 Posts: 31
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|