Define Result Fields
Type definitions using field names or constants and operators, press Enter.
Operators: +, -, *, /, SUBSTR, ||, DATE...
Field
Expression
Column Heading
Len Dec
YYDDD_____ DATE(MMDDYY)_____________________ ____________________ _____ __
_________________________________ ____________________
_________________________________ ____________________
__________ _________________________________ ____________________ _____ __
_________________________________ ____________________
_________________________________ ____________________
Bottom
_______________________________________________________________________________
Field
Text
Len Dec
MMDDYY
Date field in MMDDYY format
8
L
Bottom
F3=Exit
F5=Report
F9=Insert
F11=Display names only
F12=Cancel
F13=Layout
F20=Reorganize
F24=More keys
The commands to run the query in example 3 are:
CHGJOB DATFMT(*JUL)
RUNQRY QRY(YYDDD)
Example 3—Converting from YYDDD to MMDDYY format in Query for iSeries
The following Define Result Fields panel defines a YYDDD to MMDDYY date conversion. The conversion
is done completely within the panel.
Define Result Fields
Type definitions using field names or constants and operators, press Enter.
Operators: +, -, *, /, SUBSTR, ||, DATE...
Field
Expression
Column Heading
Len Dec
YY________ SUBSTR(DIGITS(YEAR(YYDDD)),9,2)__ ____________________ _____ __
_________________________________ ____________________
_________________________________ ____________________
MM________ SUBSTR(DIGITS(MONTH(YYDDD)),9,2)_ ____________________ _____ __
_________________________________ ____________________
_________________________________ ____________________
DD________ SUBSTR(DIGITS(DAY(YYDDD)),9,2)___ ____________________ _____ __
_________________________________ ____________________
_________________________________ ____________________
MMDDYY____ MM_||_’/’_||_DD_||_’/’_||_YY_____ ____________________ _____ __
_______________________________________________________________________________
Field
Text
Len Dec
YYDDD
Date field in YYDDD format
6
L
Bottom
F3=Exit
F5=Report
F9=Insert
F11=Display names only
F12=Cancel
F13=Layout
F20=Reorganize
F24=More keys
Example 4—Converting from MMDDYY to YYDD format in Query for iSeries
This example shows an alternative method for the same conversion done in example 3. The conversion is
done completely within the panel. This method requires that the date format for the current job must be set
to MMDDYY. When this circumstance exists, the DATE function automatically does the conversion.
82
Query for iSeries Use V5R2
Summary of Contents for ISERIES SC41-5210-04
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 ...