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

MOVE FUNCTION CURRENT-DATE TO not working


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

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Thu Aug 05, 2010 4:40 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Aug 05, 2010 4:48 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 4:49 pm
Reply with quote

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
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Thu Aug 05, 2010 5:01 pm
Reply with quote

@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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Aug 05, 2010 5:02 pm
Reply with quote

Click here -

www.ibmmainframes.com/viewtopic.php?p=235465&highlight=#235465

This will solve your current-date request in COBOL II but not your GMT-offset.

Bill
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Thu Aug 05, 2010 5:17 pm
Reply with quote

@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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 5:25 pm
Reply with quote

why do you not look in the manual?

Format 2 (System Information Transfer)
3.1.3 DATE, DAY, DAY-OF-WEEK, and TIME
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: Thu Aug 05, 2010 5:27 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 5:27 pm
Reply with quote

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
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Calling an Open C library function in... CICS 1
Search our Forums:

Back to Top