selection on specific year, month, and day values. The marked (*) lines are necessary and a sample report
follows. If you require rounding for fields in the report (instead of truncation), you can add to each of the
intermediate expressions a minus one half, as follows:
MM = (MMDDYY/10000)-0.5
.
Example 1
5728QU1 R03 M00 900824 IBM OS/400 Query 10/04/90 14:17:45 Page 1
Query . . . . . . . . . . . . . . . . . YYMMDD02
Library . . . . . . . . . . . . . . . CRP
Query text . . . . . . . . . . . . . . MMDDYY to YYMMDD
Collating sequence . . . . . . . . . . Hexadecimal
Processing options
*
Use rounding . . . . . . . . . . . . No
Ignore decimal data errors . . . . . No (default)
Selected files
ID
File
Library
Member
Record Format
T01
MMDDYY
QTEMP
MMDDYY
MMDDYY
Result fields
Name
Expression
Column Heading Len Dec
* MM
(mmddyy/10000)
2
0
* DD
(mmddyy/100 - (mm * 100))
2
0
* YY
(mmddyy - (mm*10000 + dd*100))
2
0
* YYMMDD (yy*10000)+(mm*100)+dd
6
0
* * * * *
E N D
O F
Q U E R Y
P R I N T
* * * * *
MM DD
YY
YYMMDD MMDDYY
08 31
90
900831 083190
* * * E N D O F R E P O R T * * *
Example 2: Working with numeric dates in Query for iSeries:
This example shows the reverse in
formatting— converting a numeric YYMMDD to MMDDYY. The marked (*) lines are necessary and a
sample report follows.
Example 2
Query . . . . . . . . . . . . . . . . . YYMMDD01
Library . . . . . . . . . . . . . . . CRP
Query text . . . . . . . . . . . . . . YYMMDD to MMDDYY
Collating sequence . . . . . . . . . . EBCDIC
Processing options
*
Use rounding . . . . . . . . . . . . No
Ignore decimal data errors . . . . . No (default)
Special conditions
*** All records selected by default ***
Selected files
ID
File
Library
Member
Record Format
T01
YYMMDD
QGPL
JUNK
YYMMDD
Result fields
Name
Expression
Column Heading
Len Dec
* YY
(yymmdd/10000)
2
0
* MM
(yymmdd/100 - (yy * 100))
2
0
* DD
(yymmdd - (yy*10000 + mm*100))
2
0
* MMDDYY (mm*10000)+(dd*100)+yy
6
0
* * * * *
E N D
O F
Q U E R Y
P R I N T
* * * * *
MM DD YY
MMDDYY YYMMDD
08 31 90
083190 900831
* * * E N D O F R E P O R T * * *
72
Query for iSeries Use V5R2
Summary of Contents for @server iSeries
Page 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 2: ......
Page 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 12: ...x Query for iSeries Use V5R2 ...
Page 14: ...2 Query for iSeries Use V5R2 ...
Page 32: ...20 Query for iSeries Use V5R2 ...
Page 38: ...26 Query for iSeries Use V5R2 ...
Page 44: ...32 Query for iSeries Use V5R2 ...
Page 116: ...104 Query for iSeries Use V5R2 ...
Page 122: ...110 Query for iSeries Use V5R2 ...
Page 146: ...134 Query for iSeries Use V5R2 ...
Page 150: ...138 Query for iSeries Use V5R2 ...
Page 174: ...162 Query for iSeries Use V5R2 ...
Page 178: ...166 Query for iSeries Use V5R2 ...
Page 196: ...184 Query for iSeries Use V5R2 ...
Page 198: ...186 Query for iSeries Use V5R2 ...
Page 204: ...192 Query for iSeries Use V5R2 ...
Page 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Page 206: ...194 Query for iSeries Use V5R2 ...
Page 210: ...198 Query for iSeries Use V5R2 ...
Page 242: ...230 Query for iSeries Use V5R2 ...
Page 256: ...244 Query for iSeries Use V5R2 ...
Page 270: ...258 Query for iSeries Use V5R2 ...
Page 272: ...260 Query for iSeries Use V5R2 ...
Page 292: ...280 Query for iSeries Use V5R2 ...
Page 293: ......
Page 294: ... Printed in U S A SC41 5210 04 ...