View previous topic :: View next topic
|
Author |
Message |
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Hi All,
I am using COBOL-72, and the statement
Code: |
MOVE FUNCTION CURRENT-DATE TO WS-CURRENT-DATE-FIELDS
|
is not working.
The error message I am getting is -
Code: |
"FUNCTION" was specified as an informational word in the current reserved word
used may be different from the IBM-supplied default. Refer to VS COBOL II App
Reference for information on reserved words.
"FUNCTION" was not defined as a data-name. The statement was discarded.
|
The Destination field has been defined as -
Code: |
01 WS-CURRENT-DATE-FIELDS.
05 WS-CURRENT-DATE.
10 WS-CURRENT-YEAR PIC X(04).
10 WS-CURRENT-MONTH PIC X(02).
10 WS-CURRENT-DATE PIC X(02).
05 WS-CURRENT-TIME.
10 WS-CURRENT-HOUR PIC 9(2).
10 WS-CURRENT-MINUTE PIC 9(2).
10 WS-CURRENT-SECOND PIC 9(2).
10 WS-CURRENT-MS PIC 9(2).
10 WS-GMT-SIGN PIC X(01).
10 WS-GMT-TIME PIC X(04).
|
Do let me know, where I am going wrong |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
COBOL Intrinsic Functions, such as FUNCTION CURRENT-DATE, were not introduced until COBOL/370, some 15-17 years ago, which was the successor to VS/COBOL II.
Check with your System's staff and ask if "LE" (Language Environment) has been installed in your LPAR. If so, then review the LE Callable Service routines "CEELOCT" and "CEEGMTO".
Bill |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
since when does COBOL II use the reserved word FUNCTION?
Bill,
I don't think the TS has any idea what he is using (or doing).
Within the errormsg, it says refer to the COBOL II Reference Manual,
so he is using a COBOL II compiler. |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
@dbzTHEdinosauer - I am actually bit lost in this error, I am not getting head and tail of the error, so posted here. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
@Bill O'Boyle - Thanks, Now I understood the error.
Also thanks for link, but the link is about the current date, my requirement is to get the current timestamp.
Earlier, I used to query SYSIBM.SYSDUMMY1, but due to programming constraint I cannot use. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You need to check with your system's personnel regarding whether "LE" is installed in your LPAR.
Assuming this is BATCH and "LE" is not installed, review the COBOL "ACCEPT" verb to obtain (amongst others), the Time-of-Day.
Keep in mind that the COBOL II "ACCEPT" verb for the current-date is not Y2K friendly (returns a YYMMDD Date). Calling "IGZEDT4" will return a Y2K friendly date, FMT=CCYYMMDD.
However, obtaining the GMT-offset without "LE" (CEEGMTO) is a calculation which requires an Assembler sub-program.
Bill |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
my requirement is to get the current timestamp. |
fortunately the link I provided will show you how to obtain the date and time.
for future reference: state all your requirements.
this is a 6 post thread which could have been resolved in 2. |
|
Back to top |
|
|
|