Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Get Yesterday's date in EZT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Get Yesterday's date in EZT
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

Site Director


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

PostPosted: Tue Apr 06, 2010 9:30 am    Post subject:
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: 94
Location: India

PostPosted: Tue Apr 06, 2010 9:39 am    Post subject: Reply to: Get Yesterday's date in EZT
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: 2435
Location: Netherlands, Amstelveen

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

Look here to find the lay-out for the SYSDATE field :

http://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    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 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
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us