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

getting todays date in Eazytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Tue Apr 07, 2009 2:09 pm
Reply with quote

Hi,
Is there any function or command in Eazytrieve to get the current date.

Thank you,
Ravi.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Apr 07, 2009 2:53 pm
Reply with quote

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

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Apr 07, 2009 3:48 pm
Reply with quote

Forgot to mention, SYSDATE function will have MM/DD/YY format.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Apr 07, 2009 10:26 pm
Reply with quote

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). icon_sad.gif
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Wed Apr 08, 2009 9:02 am
Reply with quote

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

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Wed Apr 08, 2009 9:34 am
Reply with quote

Ravi,
Try this
SELECT CURRENT DATE FROM
SYSIBM.SYSDUMMY1
WITH UR;
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Wed Apr 08, 2009 10:29 am
Reply with quote

Hi anand,
Is it possible to use the code you mentioned in an Eazytrieve module directly?
Thank you ,
Ravi.
Back to top
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Wed Apr 08, 2009 10:35 am
Reply with quote

Ravi,
Yes thats possible
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Apr 08, 2009 11:40 am
Reply with quote

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

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Wed Apr 08, 2009 12:31 pm
Reply with quote

KSK,

How did you accomplish it in EZT program?? Can you plz share the method of doing that?

Thank you,
Ravi
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Apr 08, 2009 9:32 pm
Reply with quote

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

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Thu Apr 09, 2009 4:36 pm
Reply with quote

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
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 -> CA Products

 


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 Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top