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

Get Yesterday's date in EZT


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

New User


Joined: 21 Mar 2007
Posts: 9
Location: United states

PostPosted: Tue Apr 06, 2010 9:18 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 06, 2010 9:30 am
Reply with quote

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

New User


Joined: 10 Sep 2008
Posts: 93
Location: India

PostPosted: Tue Apr 06, 2010 9:39 am
Reply with quote

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Apr 06, 2010 1:37 pm
Reply with quote

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