I'm not able to give you an example of a working view just now,
but I am working on an example as time permits.

No doubt someone else on this list or others can and will respond
before I do.

Here is a trivial example using the standard CORPDATA database
that is available on all iSeries:

select * from corpdata/employee
where hiredate = current_date

This query returns no rows because none of the sample data
has a hiredate which matches my system date, but it does
illustrate what Vernon stated yesterday: the current_date
special register can be used to select records.

I have not yet been able to create a view (a "logical file" if you will),
which uses current_date, but I do think a UDTF (User Defined Table Function)
will be possible if a view is not.

Also, if you do not have the corpdata schema (library) on your system,
you should be able to create it using the following from STRSQL or
another SQL interface:

CALL QSYS/CREATE_SQL_SAMPLE ('CORPDATA')

This may be useful to you as part of your steps to begin with DDL.

Best wishes on your journey.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Hoteltravelfundotcom
Sent: Tuesday, May 21, 2013 6:40 AM
To: Midrange Systems Technical Discussion
Subject: Re: include current date in logical file

I have no idea where to begin with the DDL or any of the elegant ideas given me here.
What are the steps needed to create this view ? I too want to stop using DDS. It is all I remember from AS/400 haven;'t been using for 5 years and back then the last shop was green screen strictly, this is a great way to modernize for us but how.


On Tue, May 21, 2013 at 8:31 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>wrote:

... and an SQL index cannot be accessed directly within an SQL
statement, but an SQL index can be used with native I/O like any keyed
logical file, i.e. in RPG it can be specified within the F-Specs, Read
with CHAIN, READ etc. OpCodes and updated or written with the
appropriate UPDATE and WRITE OpCodes.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
them and keeping them!"

-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von rob@xxxxxxxxx
Gesendet: Tuesday, 21.5 2013 13:43
An: Midrange Systems Technical Discussion
Betreff: Re: include current date in logical file

With the index doing only ordering then you will have no problem
adapting to this new request.

There is some rudimentary selection capability in an index. It was
really only added there to allow DDL to replace about 90% of all DDS
logical files.
90% of DDS logical files are R IIML01R
...
S ActRec comp('A')
K ItemNumber



Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600
Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Booth Martin <booth@xxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 05/20/2013 06:31 PM
Subject: Re: MIDRANGE-L Digest, Vol 12, Issue 1084
Sent by: midrange-l-bounces@xxxxxxxxxxxx




Not possible, so far as I know.

As an aside, I would mention this: In my experience, if you do
succeed with your goal, and you provide a fantastic report of today's
orders, surer than the ocean reaching the shore someone will marvel at
it and say "Now just add in a date selector so we can find orders for any day.
That shouldn't take long."


On 5/20/2013 5:22 PM, Crystal Reports wrote:
How do you refer to current date in DDS logical file?


--
Booth Martin
802-461-5349
http://www.martinvt.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.