自由形式構文 | (許可されていない - %DATE、%TIME、および %TIMESTAMP 組み込み関数を使用) |
コード | 演算項目 1 | 演算項目 2 | 結果フィールド | 標識 | ||
---|---|---|---|---|---|---|
TIME | 転送先フィールド |
TIME 命令は、プログラムの処理中の任意の時点でシステム時刻 またはシステム日付 (あるいはその両方) にアクセスします。 システム時刻は 24 時間時計に基づいています。
結果フィールドには次のいずれかを指定することができます。そこには、 時刻、または時刻とシステム日付が書き込まれます。
結果フィールド | 戻り値 | 形式 |
6 桁の数値 | 時刻 | hhmmss |
12 桁の数値 | 時刻および日付 | hhmmssDDDDDD |
14 桁の数値 | 時刻および日付 | hhmmssDDDDDDDD |
時刻 | 時刻 | 結果の形式 |
日付 | 日付 | 結果の形式 |
タイム・スタンプ | タイム・スタンプ | *ISO |
結果フィールドが数値フィールドである場合、時刻にだけアクセスする には、結果フィールドを 6 桁の 数値フィールドとして指定します。 時刻とシステム日付の両方をアクセスする場合には、結 果フィールドを 12 桁 (年の部分が 2 桁) または 14 桁 (年の部分が 4 桁) の数値フィールドとして指定します。 時刻は、常に結果フィールドの最初の 6 桁に次の形式で入れられます。
結果フィールドが数値フィールドで、システム日付が含まれる 場合には、結果フィールドの 7-12 桁目または 7-14 桁目に入れられます。日付の形式は、日付の形式のジョブ属性 DATFMT によって異なり、mmddyy、ddmmyy、yymmdd、または年間通算日にすることがで きます。 年の部分が 2 桁の年間通算日形式では、7 から 8 桁目に年、9-11 桁目に日 (1-366、右寄せされて、未使用の高位桁には 0 が入る)、12 桁目に 0 が入ります。 年の部分が 4 桁の場合には、7-10 桁目に年、11-13 桁目に日 (1-366、右寄せ されて、未使用の高位桁にはゼロが入る)、14 桁目に 0 が入ります。
結果フィールドがタイム・スタンプである場合、マイクロ秒部分の 最後の 3 桁は常に 000 です。
詳細については、情報命令を参照してください。
D Timeres S T TIMFMT(*EUR) D Dateres S D DATFMT(*USA) D Tstmpres S Z *...1....+....2....+....3....+....4....+....5....+....6....+....7...+.... CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.... * * When the TIME operation is processed (with a 6-digit numeric * field), the current time (in the form hhmmss) is placed in the * result field CLOCK. The TIME operation is based on the 24-hour * clock, for example, 132710. (In the 12-hour time system, 132710 * is 1:27:10 p.m.) C TIME Clock 6 0 * When the TIME operation is processed (with a 12-digit numeric * field), the current time and day is placed in the result field * TIMSTP. The first 6 digits are the time, and the last 6 digits * are the date; for example, 093315121579 is 9:33:15 a.m. on * December 15, 1979. C TIME TimStp 12 0 C MOVEL TimStp Time 6 0 C MOVE TimStp SysDat 6 0 * This example duplicates the 12-digit example above but uses a * 14-digit field. The first 6 digits are the time, and the last * 8 digits are the date; for example, 13120001101992 * is 1:12:00 p.m. on January 10, 1992. C TIME TimStp 14 0 C MOVEL TimStp Time 6 0 C MOVE TimStp SysDat 8 0 * When the TIME operation is processed with a date field, * the current date is placed in the result field DATERES. * It will have the format of the date field. In this case * it would be in *USA format ie: D'mm/dd/yyyy'. C TIME Dateres * When the TIME operation is processed with a time field, * the current time is placed in the result field TIMERES. * It will have the format of the time field. In this case * it would be in *EUR format ie: T'hh.mm.ss'. C TIME Timeres * When the TIME operation is processed with a timestamp field, * the current timestamp is placed in the result field TSTMPRES. * It will be in *ISO format. * ie: Z'yyyy-mm-dd-hh.mm.ss.mmmmmm' C TIME Tstmpres
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.