Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
getting todays date in Eazytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Tue Apr 07, 2009 2:09 pm    Post subject: getting todays date in Eazytrieve
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: 356
Location: New York

PostPosted: Tue Apr 07, 2009 2:53 pm    Post subject:
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: 356
Location: New York

PostPosted: Tue Apr 07, 2009 3:48 pm    Post subject:
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    Post subject:
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: 103
Location: India

PostPosted: Wed Apr 08, 2009 9:02 am    Post subject:
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    Post subject: Reply to: getting todays date in Eazytrieve
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: 103
Location: India

PostPosted: Wed Apr 08, 2009 10:29 am    Post subject:
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    Post subject: Reply to: getting todays date in Eazytrieve
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: 356
Location: New York

PostPosted: Wed Apr 08, 2009 11:40 am    Post subject:
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: 103
Location: India

PostPosted: Wed Apr 08, 2009 12:31 pm    Post subject:
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    Post subject:
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: 103
Location: India

PostPosted: Thu Apr 09, 2009 4:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us