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




On 20/12/2007, at 1:23 AM, Dave Kahn wrote:

Thanks for the explanation, Charles. The problem with DMPOBJ is that I
can't find clear text data I know to be in the database in the spooled
output. I don't see therefore how I can use it to identify my
internally formatted dates.

As far as I know neither DMPOBJ nor DMPSYSOBJ will show the data in a file** however SST will show it.

Add the following DDS source:

R FORMAT
A TEXT1 10
A SCALIGER L DATFMT(*ISO)
A TEXT2 20

Compile it.

Add a single record with data:

INSERT INTO the-file VALUES('RECORD 1', '2007-12-31', 'DATE: 2007-12-31')

Dump the-file and locate the address of the *QDDS object. For example:

OBJECT TYPE- DATA SPACE *QDDS
NAME- SCALIGERPFSCALIGERPF TYPE- 0B SUBTYPE- 90
CREATION- 20/12/07 07:49:33 SIZE- 0000002000
OWNER- SHC TYPE- 08 SUBTYPE- 01
ATTRIBUTES- 0800 ADDRESS- 00889C2DD1 000000

Note down the address.

STRSST
Authenticate if necessary
1. Start a service tool
4. Display/Alter/Dump
1. Display/Alter storage
1. Machine Interface (MI) object
11. Data space (0B)
2. Find by object address
Enter the address of the *QDDS object you noted earlier
A confirmation screen is displayed. Press Enter.
2. Display formatted data in hexadecimal
Type DATA SEGMENT into the 'Find' field and press F2

You will now see the data content of the file. For example:

40404080D9C5C3D6 D9C440F140400025 73C2C4C1E3C57A40 F2F0F0F760F1F260 * .RECORD 1 ...BDATE: 2007-12-*

By using the known data entered for TEXT1 and TEXT2 we can see that the value for the SCALIGER date field is x'002573C2'. Converting this to decimal gives 2454466 which is the Scaliger number for the date 2007-12-31. This can be proved (although it's a self-referential proof) by using the CVTD MI instruction to convert that Scaliger value to a date. For example:

Convert Scaliger (SCALIGER)

Type choices, press Enter.

Scaliger date . . . . . . . . . SCALIGER 2454466
Date format . . . . . . . . . . FORMAT *ISO
Date separator . . . . . . . . . SEPARATOR *DFT

Gives:

DSPLY 2454466
DSPLY 2007-12-31

So you can see we have proved the database uses 4-byte internal values (thus saving space) but it is always surfaced as a formatted date data type in effective character representation (thus giving ease of use in most situations).

For those still interested there was a discussion on dates and durations on the MI list in October 2005 (Compute Date Duration) starting at http://archive.midrange.com/mi400/200510/msg00043.html and culminating in the information at http://archive.midrange.com/ mi400/200510/msg00076.html before it devolved into silliness.

For my next trick I might investigate defining different Era tables for BC and AD or perhaps the Japanese Era's since 1868 but the farm is calling and I have fruit trees to attend and grass to slash and a mower to repair.

**I know the data is not actually *IN* the *FILE object but you know what I mean.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.