View previous topic :: View next topic
|
Author |
Message |
prerna_gupta11
New User
Joined: 21 Mar 2007 Posts: 9 Location: United states
|
|
|
|
Hi All,
How can i get yesterday's date in a easytrieve? I tried the below function like we do in SQL, but looks like it doesnt work:
Code: |
CURRENT-DATE W 10 A
CURRENT-MM CURRENT-DATE 02 A
CURRENT-DD CURRENT-DATE +3 02 A
CURRENT-YY CURRENT-DATE +6 04 A
CURRENT-DATE = SYSDATE-LONG - 1
|
Can anyone please help?
Below is the error I am getting:
Code: |
CURRENT-DATE = SYSDATE-LONG - 1
*******B055 INVALID LENGTH, TYPE OR DECIMAL PLACES - CURRENT-DATE
*******B055 INVALID LENGTH, TYPE OR DECIMAL PLACES - SYSDATE-LONG
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I tried the below function like we do in SQL, but looks like it doesnt work: |
It is not a good idea to just make up functions for a language. . . One should restrict oneself to product provided features.
You could use a db2 query to generate the date of "yesterday".
Many (most) organizations have callable routines that provide data arithmetic - suggest you see what is already available on the system. |
|
Back to top |
|
|
Ranjithkumar
New User
Joined: 10 Sep 2008 Posts: 93 Location: India
|
|
|
|
You have defined the variables as ALPHA NUMERIC and tried to do arithmetic operation on them. Also you have to know the definition of SYSDATE-LONG and the value it might return.
As Dick suggested there will be routines already available at your system. Please try to investigate. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Look here to find the lay-out for the SYSDATE field :
ibmmainframes.com/viewtopic.php?t=46533&highlight=eztpopt
Beside that the Easytrev Reference Guide will give some more info
about those date formats.
In my IT life i always had to convert those EZT dates by calling a
standard date conversion routine to do any mathematics with a date. |
|
Back to top |
|
|
|