Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

MOVE FUNCTION CURRENT-DATE TO not working

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: MOVE FUNCTION CURRENT-DATE TO not working
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Aug 05, 2010 4:48 pm    Post subject: Reply to: MOVE FUNCTION CURRENT-DATE TO not working
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: 6968
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 4:49 pm    Post subject:
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    Post subject: Reply to: MOVE FUNCTION CURRENT-DATE TO not working
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Aug 05, 2010 5:02 pm    Post subject: Reply to: MOVE FUNCTION CURRENT-DATE TO not working
Reply with quote

Click here -

http://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    Post subject: Reply to: MOVE FUNCTION CURRENT-DATE TO not working
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: 6968
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 5:25 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Aug 05, 2010 5:27 pm    Post subject: Reply to: MOVE FUNCTION CURRENT-DATE TO not working
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: 6968
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 5:27 pm    Post subject:
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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us