Although conditioning indicators should not be used to control RPG operations, there are groups of operations that cannot be conditioned with indicators. Table 5.3 lists these operations. Most of these operations
|
Op Code |
Description |
|---|---|
|
AND xx |
Continuation of the IF xx , DOW xx , DOU xx , and WHEN xx operations. |
|
BEGSR |
Begin subroutine. |
|
DEFINE |
Define variable; data area declaration. |
|
ELSE |
Else operation of the IF xx operation. |
|
ENDIF |
End IF xx . |
|
ENDCS |
End CAS xx . |
|
ENDSL |
End SELECT. |
|
ENDSR |
End subroutine. |
|
KFLD |
Index key field declaration. |
|
KLIST |
Index key list declaration. |
|
OR xx |
OR continuation of the IF xx , DOW xx , DOU xx , and WHEN xx operations. |
|
OTHER |
Otherwise clause of a SELECT/WHEN case
|
|
PARM |
Parameter. |
|
PLIST |
Parameter list. |
|
TAG |
Target of a CAB xx or GOTO operation. |
|
WHEN xx |
When compare clause of a select CASE group. |
Date, time, and timestamp (DTS) values can be converted from character, numeric, or literal format to a valid date, time, or timestamp variable using the MOVE and MOVEL operations. In addition, character and numeric
When moving a DTS variable's value to a non-DTS variable, factor 1 of the MOVE or MOVEL operations
|
Date Format |
Description |
Output Format |
Separator |
Length |
Sample |
|---|---|---|---|---|---|
|
*JOBRUN |
Job runtime format |
varies |
|||
|
*JOB |
Job start date |
N/A |
INZ(*JOB) |
||
|
*SYS |
Current system date |
N/A |
INZ(*SYS) |
||
|
*MDY |
Month, Day, Year |
mm/dd/yy |
/ - . , & |
8 |
02/17/95 |
|
*DMY |
Day, Month, Year |
dd/mm/yy |
/ - . , & |
8 |
17/02/95 |
|
*YMD |
Year, Month, Day |
yy/mm/dd |
/ - . , & |
8 |
95/02/17 |
|
*CYMD |
Century, Year, Month, Day |
cyy/mm/dd |
/ - . , & |
9 |
095/02/17 |
|
*CMDY |
Century, Month, Day, Year |
cmm/dd/yy |
/ - . , & |
9 |
002/17/95 |
|
*CDMY |
Century, Day, Month, Year |
cdd/mm/yy |
/ - . , & |
9 |
017/02/95 |
|
*JUL |
Julian (year, day of year 1 – 365) |
yy/ddd |
/ - . , & |
6 |
95/048 |
|
*LONGJUL |
Long Julian |
yyyy/ddd |
8 |
1999/048 |
|
|
*ISO |
International Standards Organization |
ccyy-mm-dd |
- (fixed) |
10 |
1995-02-17 |
|
*USA |
IBM's USA Standard |
mm/dd/ccyy |
/ (fixed) |
10 |
02/17/1995 |
|
*EUR |
IBM's European Standard |
dd.mm.ccyy |
(fixed) |
10 |
17.02.1995 |
|
*JIS |
Japanese Industrial Standard |
ccyy-mm-dd |
- (fixed) |
10 |
1995-02-17 |
Although all date formats accept a separator character, only *MDY, *YMD, *DMY, *CMDY, *CYMD, and *CDMY date formats support various separators. In addition, a separator of 0 (zero) indicates that no separator is used and may be used with any date format.
Most time formats are similar. The only notable exception is the *USA format that is based on a 12-
|
Time Format |
Description |
Output Format |
Separator |
Length |
Sample |
|---|---|---|---|---|---|
|
*JOBRUN |
Job runtime format |
Varies |
|||
|
*JOB |
Job start time |
N/A |
INZ(*JOB) |
||
|
*SYS |
System time |
N/A |
INZ(*SYS) |
||
|
*HMS |
Hours, Minutes, Seconds |
hh:mm:ss |
: . , & |
8 |
15:30:00 |
|
*ISO |
International Standards Organization |
hh.mm.ss |
(fixed) |
8 |
15.30.00 |
|
*USA |
IBM's USA Standard |
Hh:mm am hh:mm pm |
: (fixed) |
8 |
03:30 pm |
|
*EUR |
IBM's European Standard |
hh.mm.ss |
(fixed) |
8 |
15.30.00 |
|
*JIS |
Japanese Industrial Standard |
hh:mm:ss |
: (fixed) |
8 |
15:30:00 |
The format of a timestamp field is fixed. It is a single-format data type that
CCYY-MM-DD-HH.MN.SS.MMMMMM
The format of the timestamp data type is the combination of the *ISO date format, the *ISO time format, and a 6-position microseconds entry. Note that only