Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MF-COBOL - PC Environment - DATE Function 1

Status
Not open for further replies.

tsravihyd

Programmer
Sep 1, 2003
10
US
Hi,
I am using MF Cobol 16/32 bit version (Non-GUI) and want to try using the Intrinsic Date Functions. But unfortunately, the code is not working on DOS/Win'98 platform, where as the same code works well on the same MF Cobol with RM Compatability on Unix/AIX O/S.
Any one has come across similar issue... Please help me out
Thanks in Advance
TSR
 
I usually have something like this
Code:
Accept Ws-Time From Time
Accept Ws-Date From Date

HTH
TonHu
 
I agree with the question "what do you mean"? Do you get a compiler error? a run-time error? wrong results?

What RELEASE of the Micro Focus compiler are you using? I think that "intrinsic functions" were added in ABOUT V3.0 - so if you have a truly "ancient" compiler, it may not support it - but you should be told that at compile-time, not run-time.

Bill Klein
 
Hi WebRabbit/WMK/TonHu,

Your questioning is right, the error is given at Compile stage itself. The version is Micro Focus Cobol / 2 (V 2.5.25). Why I had this problem is coz, using the HyHelp shipped along with this version, the intrinsic functions like FUNCTION INTEGER-OF-DATE etc have been provided, but when used in the code, the error is raised during Compile Time.
Please Advice
Thanks
 
V2.5 is so old, that I don't know who will be able to help you (much) with it). If the help SAYS that it has intrinsic functions, then it might. I would check to see if the ANS85 compiler directive is turned on or not, if not, then I think you could try that.

Bill Klein
 
Thanks Bill,

Will check that out and revert ... Thanks for the help.
TSR
 
Hi Bill,

Thank you very much, your suggestion of ANS85 did solve my problem. Thank you once again.
TSR
(Thanks to others too for their replies) :)
 
Hi,

A little remark about using DATE and TIME:

There is a little risc here with those statements using them at midnight. You can get an old date with a new time. After accepting the time, you should get the DATE again and compare it with the previous date. If it is not the same, accept the TIME again.

Regards,

Crox
 
Hi Crox,

Thank you very much for the valuable suggestion. This issue did come up and have followed the similar logic you had mentioned.

Thanks once again.
TSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top