View previous topic :: View next topic
|
Author |
Message |
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi,
Is there any function or command in Eazytrieve to get the current date.
Thank you,
Ravi. |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
SYSDATE function will give you current date.
Code: |
WS-DATE1 = SYSDATE.
|
Find below explanation.
Quote: |
SYSDATE is a read only eight-byte alphanumeric field which contains the system date at the start of EASYTRIEVE PLUS execution.
|
|
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Forgot to mention, SYSDATE function will have MM/DD/YY format. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
I don't know if it still does, but Easytrieve Plus used to zero suppress the MM for Jan through Sep. That bit me one time when I used the MM portion of SYSDATE in a calculation (S0C7). |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi Terry,
I am facing the problem you mentioned. my date field has value '04/08/09' but the value sysdate returns is ' 4/08/09'. Note that there is a null before 4.
So when i compare these two fields its always giving false.
Any way to overcome this problem??
Thank you,
Ravi |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Ravi,
Try this
SELECT CURRENT DATE FROM
SYSIBM.SYSDUMMY1
WITH UR; |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi anand,
Is it possible to use the code you mentioned in an Eazytrieve module directly?
Thank you ,
Ravi. |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Ravi,
Yes thats possible |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Terry,
Yes, you are correct. I have forgot to mention this zero suppression. We have handled manually in the EZT program itself.
E.g., if that position contains space, move zero. |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
KSK,
How did you accomplish it in EZT program?? Can you plz share the method of doing that?
Thank you,
Ravi |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
My solution was the same as ksk -- I moved SYSDATE to a working storage field, replaced any leading space with a zero, and used that for any calculations from then on. My program also didn't involve DB2. |
|
Back to top |
|
|
hiravibk Warnings : 1 Active User
Joined: 14 Dec 2008 Posts: 107 Location: India
|
|
|
|
Hi ,
I used the method Terry had suggested..It is simple and works fine for me..Thank you all for giving your valuable suggestions.
Thank you,
Ravi.. |
|
Back to top |
|
|
|