Using DATE in AS400 DDS

Posted on 2009-05-24
Medium Priority
Last Modified: 2012-05-07
I have a request to create a logical file that include records with a transaction date within the last 30 days and omits all others. The the only way I know how to do this would be to auto run a SQLRPGLE job every AM to reset the date and recreate the logical file. Is there any way to do this via DDS?

Question by:carlbb
  • 3
  • 2
LVL 36

Expert Comment

by:Gary Patterson
ID: 24473234
No way I know of to do it via DDS, but it is easy with SQL:

- Gary Patterson

   SELECT * from MyTable WHERE somedate >= current_date - 30 days 

Open in new window


Author Comment

ID: 24475033
Would the view need to be dropped and created each day?
LVL 36

Accepted Solution

Gary Patterson earned 2000 total points
ID: 24478241
No, it is dynamic.

- Gary Patterson

Author Closing Comment

ID: 31585571
Thank you Gary that will get me started, if have other questions I will do another post.

Thanks again
LVL 36

Expert Comment

by:Gary Patterson
ID: 24482358
Happy to help.

- Gary

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.
When the first reports of the initial sales of Nintendo Switch in the Land of the Rising Sun appeared. In Japan, only 330,637 consoles were sold for the first day. But many large retail chains have already sold out the entire edition of the console …
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question