Hi Chuck
sorry I didn't answer everyone's replies - production problems
This is VERRRYYYY NIIIIIIICE
It gives me EXACTLY what I am looking for
MUCH appreciated

Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of CRPence
Sent: Tuesday, April 12, 2011 5:55 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: Key a logical file by date within a timestamp field

Given: create table qtemp/z (z timestamp)

The following LF DDS should make column L with data type DATE [L], become the key by the data type date for the timestamp data in column Z with data type TIMESTAMP [Z]:

<code>

R LOZR PFILE(QTEMP/Z)
TEXT('type L over Z')
Z
L L I RENAME(Z)
K L

</code>

Another suggestion was to map [via DDS] the Z to A and then use SST to substring the 10-byte date portion, but that is not a supported mapping; searching InfoCenter on logical file dds mapping yielded the a table under subject "Describing logical file record formats" which shows that mapping to character is not a supported mapping via DDS LF [in v5r3 and still, by v6r1]:
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/dbp/rbafodrflf.htm
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/dbp/rbafodrflf.htm

Regards, Chuck

On 4/12/11 3:48 PM, Alan Shore wrote:

I keep forgetting to specify the release level we are on - which is
5.4 so I can use neither of your suggestions

Because the file is in chronological order (timestamp) the order
number 1 may in fact be the millionth record on that particular date,
but if I can create a logical by date within that timestamp, then
order number, then order number 1 will be the first for that date

I may have to create a temporary file, and populate a date field I
just thought that there may have been something equivalent to SST for
timestamp fields


Luis Rodriguez on Tuesday, April 12, 2011 4:33 PM wrote:

Are you running 6.1 or higher? If so, I wonder if using a derived key
would be of help?

Something in the order of

CREATE INDEX MYLIB/MYINDEX ON MYLIB/MYTABLE
(DATE(MY_TIMESTAMP) AS MY_DATE)

Unfortunately, we are stuck here in the dark ages (V5R3), but maybe
this would be doable...


On Tue, Apr 12, 2011 at 3:02 PM, Alan Shore<ashore@xxxxxxxx> wrote:

I have a physical file, that contains a timestamp field (type z) Is
there any way to create a logical over this physical but ONLY using
the date within that timestamp as part of the key?
As always, any and all responses MUCH appreciated

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

Replies:

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

This mailing list archive is Copyright 1997-2019 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].