× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Date performance
  • From: "Brigitte Caura" <Caura@xxxxxxxxxxxxx>
  • Date: Sun, 25 Oct 1998 22:06:54 +0100

Hi Doug,

Thanks for the Info.
Sounds great to me
(not that in short term we will change a working system, other priorities).

>So using any L-type date really only occupies 4 bytes of data each --
>the same as your current 7,0 packed fields (plus it carries the
>century info at the same time).
>

So finally the AS400 does support unsigned packed decimal (at least under
the cover).
That is something we have been asking ever since 86
(since it's indeed the ideal format for storing date fields :-) .

Only, this looks like the work of a lousy programmer: defining something as
1 format (4bytes), but showing it as something totally different (10bytes)
...
Secondly, editing is not something that is done on physical files, but on
output operations, no?

When i got it right: if I define a PF with p.e. 10 date fields it shows up
as a file with recordlength of 100, but actually it has a recordlength of
40?

Anyway, where does this Info come from?
The books clearly state a date field occupies 10 characters in storage?

from theOS 400 DDS Reference V4R2:
Chapter 3.6 Length   (of Physical & logical files)
The length for fields with data type L (date), T (time), or Z (timestamp) is
determined by the system. You should not enter a field length in positions
30 through 34.
The field length for date and time includes the separator.
A timestamp has a fixed format that has the following form:
     YYYY-MM-DD-hh.mm.ss.uuuuuu

The system determines the number of bytes actually occupied in storage as
follows:
   Data Type                              Bytes Occupied in Storage
   Character                              Number of characters
   Hexadecimal                            Number of bytes
   Binary                                 2 bytes
   1 through 4 digits                     4 bytes
   5 through 9 digits
   Zoned decimal                          Number of digits
   Packed decimal                         (Number of digits/2) + 1
(truncated if fractional)
   Floating-point                         4 bytes
   (single precision)
   Floating-point                         8 bytes
   (double precision)
   Date                                   10 characters without DATFMT
keyword
                                          and 6, 8 or 10 characters with
DATFMT keyword
   Time                                   8 characters
   Timestamp                              26 characters

Note: The system performs arithmetic operations more efficiently for a
packed decimal than for a zoned decimal data type.

Has it always been that a date field takes 4 bytes?
If so, this means we even can't trust the IBM manuals anymore?

Luc
.


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.