ステージを変更する:ステージタブ (DataStage)
「ステージ」タブでステージをダブルクリックし、設定を更新すると、「変更」ステージの各側面を指定できます。
「プロパティー」セクションでは、ステージが何を行うかを指定できます。 「拡張」セクションでは、ステージの実行方法を指定できます。
プロパティ-
| カテゴリー/プロパティー | 値 | デフォルト | 必須? | 繰り返しますか? | 従属先: |
|---|---|---|---|---|---|
| オプション/仕様 | ストリング | 該当なし | Y | Y | 該当なし |
指定
これは、以下のいずれかの形式のステートメントです。
- DROP columnname [, columnname]
- KEEP columnname [, columnname]
- new_columnname:new_type = [explicit_conversion_function] old_columnname
列のドロップを選択した場合、明示的にドロップする列以外のすべての列は保存されます。 列の保持を選択した場合、明示的に保持する列以外のすべての列は除外されます。
各行は新しい指定です。 複数の仕様を指定した場合は、各仕様が順次実行されます。
型変換 IBM® DataStage® には自動的に実行できるものと、明示的な変換関数を指定する必要があるものがあります。 また、変換できないものもあります。
次の表は使用可能性を要約したものです。縦がソース・フィールドで、横がターゲット・フィールドです。 値「d」は自動(デフォルト)変換を示し、「m」は手動変換が必要であることを示し、空白行は変換が不可能であることを示す:
| int8 | uint8 | int16 | uint16 | int32 | uint32 | int64 | uint64 | sfloat | dfloat | |
|---|---|---|---|---|---|---|---|---|---|---|
| int8 | d | d | d | d | d | d | d | d | d m | |
| uint8 | d | d | d | d | d | d | d | d | d | |
| int16 | d m | d | d | d | d | d | d | d | d | |
| uint16 | d | d | d | d | d | d | d | d | d | |
| int32 | d m | d | d | d | d | d | d | d | d | |
| uint32 | d | d | d | d | d | d | d | d | d | |
| int64 | d m | d | d | d | d | d | d | d | d | |
| uint64 | d | d | d | d | d | d | d | d | d | |
| sfloat | d m | d | d | d | d | d | d | d | d | |
| dfloat | d m | d | d | d | d | d | d | d | d | |
| 10 進数 | d m | d | d | d | d m | d | d m | d m | d | d m |
| string | d m | d | d m | d | d | d m | d | d | d | d m |
| ustring | d m | d | d m | d | d | d m | d | d | d | d m |
| raw | m | m | ||||||||
| 日付 | m | m | m | m | ||||||
| 時間 | m | m | m | |||||||
| time stamp | m | m | m |
| 10 進 | ストリング | ustring | ロー | 日付 | 時刻 | タイムスタンプ | |
|---|---|---|---|---|---|---|---|
| int8 | d | d m | d m | m | m | m | |
| uint8 | d | d | d | ||||
| int16 | d | d m | d m | ||||
| uint16 | d | d m | d m | ||||
| int32 | d | d m | d m | m | m | ||
| uint32 | d | m | m | m | |||
| int64 | d | d | d | ||||
| uint64 | d | d | d | ||||
| sfloat | d | d | d | ||||
| dfloat | d m | d m | d m | m | m | ||
| 10 進数 | d m | d m | |||||
| string | d m | d | m | m | m | ||
| ustring | d m | d | m | m | |||
| raw | |||||||
| 日付 | m | m | m | ||||
| 時間 | m | m | d m | ||||
| タイム・スタンプ | m | m | m | m |
デフォルトのタイプ変換では、仕様は以下の形式になります。
new_columnname:new_type = [explicit_conversion_function] old_columnname
例えば、int8 列タイプを作成する場合は次のようになります。
int8col:int8 = uint64col
手動による変換が必要な場合は、仕様は以下の形式になります。
new_columnname:new_type = conversion_function (old_columnname)
次に例を示します。
day_column:int8 = month_day_from_date (date_column)
new_type は、ソースからの変換でサポートされる任意の宛先タイプ (つまり、先行する表で「m」とマークされている列) であればどれでもかまいません。 例えば、hours_from_time 変換を使用して、time を int8、int16、int32、dfloat などに変換できます。 IBM DataStage は、暗黙的なデータ・タイプ変換を実行しているときに警告します。例えば、 hours_from_time は、時刻を int8に変換することを予期し、 int16、 int32、または dfloat に変換する場合は警告します。
以下の表に、使用可能な変換関数をリストします。 ソースおよび出力先は、常に列名で指定します。 大括弧内は、オプションの引数で、丸括弧内は、ソースの列名です。
| 変換 | 引数 | 出力形式 | 説明 | 例 |
|---|---|---|---|---|
| 日付の開始日 | [base_date (date)] (number_col (int32)) | 日付 | 指定された基準日に整数を加算して、整数フィールドを日付に変換します。 base_date は yyyy-mm-dd の形式でなければならず、また、倍精度浮動小数点数型でなければなりません 引用符または変数。 |
date_col:date = date_from_days_since ["1958-08-18"] (int_col) |
| date_from_julian_day | (juliandate_col (uint32)) | 日付 | ユリウス日から日付を返します。 | date_col:date = date_from_julian_day (julian_col) |
| date_from_string | [date_format] (string_col (string)) | 日付 | 指定された date_format を使用して、ストリングを日付表記に変換します。 デフォルトのストリング・フォーマットは yyyy-mm-dd です。 | date_col:date = date_from_string ["%yyyy-%mm-%dd"] (string_col) |
| date_from_timestamp | (timestamp_col (timestamp) ) | 日付 | タイム・スタンプを日付表現に変換します。 | date_col:date = date_from_timestamp (ts_col) |
| date_from_ustring | [date_format] (string_col (ustring)) | 日付 | 指定された date_format を使用して、ストリングを日付表記に変換します。 デフォルトのストリング・フォーマットは yyyy-mm-dd です。 | date_col:date = date_from_ustring (ustring_col, "%yyyy-%mm-%dd") |
| days_since_from_date | [source_date (date)] (date_col (string)) | int32 | source_date から指定の日付までの日数に対応する値を返します。 source_date の形式は、yyyy-mm-dd で、引用符で囲んでも 囲まなくてもかまいません。 | dayssince_col:int32 = days_since_from_date ["1958-08-18"] (sourcedate_col,) |
| decimal_from_decimal | [r_type] (source_decimal_col (decimal)) | 10 進 | decimal を decimal に変換します。 | decimal_col:decimal = decimal_from_decimal [ceil] (source_col) |
| decimal_from_dfloat | [r_type] (source_dfloat_col (dfloat)) | 10 進 | dfloat を decimal に変換します。 | decimal_col:decimal = decimal_from_dfloat [ceil] (source_col) |
| decimal_from_string | [r_type] (source_string_col (string)) | 10 進 | string を decimal に変換します。 | decimal_col:decimal = decimal_from_string [ceil] (source_col) |
| decimal_from_ustring | [r_type] (source_ustring_col (ustring)) | 10 進 | ustring を decimal に変換します。 | decimal_col:decimal = decimal_from_ustring [ceil] (source_col) |
| dfloat_from_decimal | [fix_zero] (source_dec_col (decimal)) | dfloat | 10 進数からの浮動小数点。 | dfloat_col:dfloat = dfloat_from_decimal [fix_zero] (source_col) |
| hours_from_time | (source_time_col (time)) | int8 | 時刻からの時間。 | hours_col:int8 = hours_from_time (time_col) |
| int32_from_decimal | [r_type, fix_zero] (source_decimal_col (decimal)) | int32 | Int32 (10 進数)。 | int32_col:int32 = int32_from_decimal [ceil] [fix_zero] (dec_col) |
| int64_from_decimal | [r_type, fix_zero] (source_decimal_col (decimal)) | int64 | Int64 (10 進数)。 | int64_col:int64 = int64_from_decimal [ceil] (dec_col) |
| julian_day_from_date | (date_col (date)) | uint32 | ユリウス日付。 | julianday_col:uint32 = julian_day_from_from_date (date_col) |
| lookup_string_from_int16 | [table_definition ], (number_col (int16)) | ストリング | ルックアップ・テーブルを使用して数値をストリングに変換します。 | gendercol:string = lookup_string_from_int16 [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_ustring_from_int16 | [table_definition ] (number_col (int16)) | ustring | ルックアップ・テーブルを使用して数値を ustring に変換します。 | gendercol:ustring = lookup_ustring_from_int16 [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_ustring_from_int32 | [table_definition ] (number_col (int32)) | ustring | ルックアップ・テーブルを使用して数値を ustring に変換します。 | gendercol:ustring = lookup_string_from_int32 [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_string_from_uint32 | [table_definition ] (number_col (uint32)) | ストリング | ルックアップ・テーブルを使用して数値をストリングに変換します。 | gendercol: string = lookup_string_from_uint32 [{default_value = 2} ('f '= 1;' m' = 2)] (gendercode) |
| lookup_int16_from_string | [table_definition ] (string_col (string)) | int16 | ルックアップ・テーブルを使用して、ストリングを数値に変換します。 | int_col:int16 = lookup_int16_from_string [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_int16_from_ustring | [table_definition ] (ustring_col (ustring)) | int16 | ルックアップ・テーブルを使用して、ストリングを数値に変換します。 | int_col:int16 = lookup_int16_from_ustring [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_uint32_from_string | [table_definition ] (string_col (string)) | uint32 | ルックアップ・テーブルを使用して、ストリングを数値に変換します。 | int_col:uint32 = lookup_uint32_from_string [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lookup_uint32_from_ustring | [table_definition ] (ustring_col (ustring)) | uint32 | ルックアップ・テーブルを使用して ustring を数値に変換します。 | int_col:uint32 = lookup_uint32_from_ustring [{default_value = 2} ('f' = 1; 'm' = 2)] (gendercode) |
| lowercase_string | (instring_col (string)) | ストリング | ストリングをすべて小文字に変換します。 変換では英字以外の文字は無視されます。 | ostring_col:string = lowercase_string (istring_col) |
| lowercase_ustring | (instring_col (ustring)) | ストリング | ustring をすべて小文字に変換します。 変換では英字以外の文字は無視されます。 | ostring_col:ustring = lowercase_string (istring_col) |
| mantissa_from_decimal (小数点以下の桁数) | (decimal_col (decimal)) | dfloat | 与えられた decimal の仮数を返します。 | matissa_col:dfloat = mantissa_from_decimal (dec_col) |
| mantissa_from_dfloat | (dfloat_col (dfloat)) | dfloat | 与えられた dfloat の仮数を返します。 | matissa_col:dfloat = mantissa_from_dfloat (dfloat_col) |
| マイクロ秒 (from_time) | (time_col (time)) | int32 | 時刻フィールドからマイクロ秒を返します。 | msec_col:int32 = microseconds_from_time (time_col) |
| ミッドナイトスフロム時間 | (time_col (time)) | dfloat | 指定された時刻の午前 0 時からの秒数を返します。 | midsec_col:dfloat = midnight_seconds_from_ time (time_col) |
| minutes_from_time | (time_col (time)) | int8 | 時刻フィールドから分を返します。 | minsec_col:int8 = minutes_from_time (time_col) |
| 月-日-日-日 | (date_col (date)) | int8 | 日付フィールドから月の日付を返します。 | monthday_col:int8 = month_day_from_date (date_col) |
| month_from_date | (date_col (date)) | int8 | 日付フィールドから数値の月を返します。 | month_col:int8 = month_from_date (date_col) |
| 次の平日からの日付 | [day] (date_col (date)) | 日付 | ソース日付 (ソース日付を含む) の後の最も早い、指定された曜日の日付を返します。 day は、曜日を指定するストリングです。 day は、曜日名の最初の3文字または完全な曜日名のいずれかで指定できます。 day を一重引用符または二重引用符で引用できます。または引用符を省略できます。 | nextday_col:date = next_weekday_from_date [wed](date_col) |
| notnull | (any) | int8 | 式が NULL 値に評価されない場合は true (1) を返します。 | isnotnull_col:int8 = notnull (test_col) |
| null | (any) | int8 | 式の評価結果が NULL 値になったら、真 (1) を返します。 | isnull_col:int8 = null (test_col) |
| 平日の前の期間の開始日 | [day] (date_col (date)) | 日付 | 書き込み先には、ソース日付以前で指定された曜日に最も近い日付が格納されます。 day は、曜日を指定するストリングです。 day は、曜日名の最初の3文字または完全な曜日名のいずれかで指定できます。 day を一重引用符または二重引用符で引用できます。または引用符を省略できます。 | prevday_col:date = previous_weekday_from_date [wed](date_col) |
| raw_from_string | (string_col (string)) | ロー | ストリングを RAW 形式に変換して返します。 | raw_col:raw = raw_from_string (string_col) |
| raw_length | (raw_col (raw)) | int32 | 未加工フィールドの長さを返します。 | rawlength_col:int32 = raw_length (raw_col) |
| seconds_from_time | (time_col (time)) | dfloat | 時刻フィールドから秒を返します。 | sec_col:dfloat = seconds_from_time (time_col) |
| 秒の正弦の開始タイム・スタンプ | (timestamp_col (timestamp)) | dfloat | timestamp によって指定された時間からの秒数 | secsince_col:dfloat = seconds_since_from_ timestamp (timestamp_col) |
| string_from_date | [date_format] (date_col (date)) | ストリング | 指定された date_format を使用して、日付をストリング表記に変換します。 | datestring_col:string = string_from_date [%dd-%mm-%yyyy] (date_col) |
| string_from_decimal | [fix_zero] (decimal_col (decimal) | ストリング | 10 進数からストリングを戻します。 | string_col:string = string_from_decimal [fix_zero] (dec_col) |
| string_from_time | [time_format] (time_col (time)) | ストリング | 指定された time_format を使用して、時間を文字列表現に変換します。 デフォルトの時刻形式は、%hh:%nn:%ss です。 | timestring_col:string = string_from_time [%hh:%nn:%ss.] (time_col) |
| ストリング・タイム・スタンプ | [timestamp_format] (timestamp_col (timestamp)) | 指定された timestamp_formatを使用して、タイム・スタンプをストリング表現に変換します。 デフォルトのタイム・スタンプ形式は、%yyyy-%mm-%dd. %hh:%nn:%ss です。 | stringtimestamp_col:string = string_from_timestamp [%yyyy-%mm-%dd. %hh:%nn:%ss.] (timestamp_col) | |
| string_from_ustring | (string_col (ustring)) | ストリング | ustring からストリングを返します。 | string_col:string = string_from_ustring (ustring_col) |
| string_length | (string_col (string)) | int32 | ストリングの長さを含む int32 を返します。 | length_col:int32 = string_length (string_col) |
| substring | [startPosition,len] (string_col (string)) | ストリング | ストリング抽出を行って長いストリングを短いストリングに変換します。 startPosition は、サブストリングの開始位置を指定します。len はサブストリングの長さを指定します。 startPosition が正の場合は、ストリングの先頭からのバイト・オフセットをストリングに指定します。 startPosition が負の場合は、ストリングの終わりからのバイト・オフセットを指定します。 | shorstring_col:string = substring [5,10] (longstring_col) |
| タイム・フロム・ミッドナイト (秒) | (dfloat_col (dfloat)) | 時刻 | 午前 0 時からの秒数フィールドの時刻を返します。 | time_col:time = time_from_midnight _seconds (dfloat_col) |
| time_from_string | [time_format] (string_col (string)) | 時刻 | 指定された time_format を使用して、ストリングを時刻表現に変換します。 デフォルトの時刻形式は、%hh:%nn:%ss です。 | time_col:time = time_from_string [%hh:%nn:%ss.] (string_col) |
| time_from_timestamp | (timestamp_col (timestamp)) | 時刻 | タイム・スタンプから時刻を返します。 | time_col:time = time_from_timestamp (timestamp_col) |
| time_from_ustring | (string_col (ustring)) | 時刻 | ustring から時刻を返します。 | time_col:time = time_from_ustring (string_col) |
| timestamp_from_date | [time](date_col (date)) | タイム・スタンプ | 日付からタイム・スタンプを返します。 time 引数は、オプションでタイム・スタンプの結果の作成に使用される時間を指定します。これは hh:nn:ss の形式でなければなりません。 省略した場合、時刻はデフォルトで午前 0 時になります。 | timestamp_col:timestamp = timestamp_from_date [08:20:33] (date_col) |
| タイム・スタンプからの経過時間 (秒) | (secondssince_col (dfloat)) | タイム・スタンプ | 経過した秒数からタイム・スタンプを返します。 | timestamp_col:timestamp = timestamp_from_seconds_ since (secondssince_col) |
| timestamp_from_string | [timestamp_format] (string_col (string)) | タイム・スタンプ | 指定された timestamp_formatを使用して、ストリングをタイム・スタンプ表現に変換します。 ストリングのデフォルトの形式は、%yyyy-%mm-%dd hh:nn:ss です。 | timestamp_col:timestamp = timestamp_from_string [%yyyy-%mm-%dd hh:nn:ss] (string_col) |
| timestamp_from_time | [date](time_col (time)) | タイム・スタンプ | 時刻からタイム・スタンプを返します。 date 引数は必須です。 この引数は、タイム・スタンプの日付部分を指定し、yyyy-mm-dd の形式でなければなりません。 | timestamp_col:timestamp = timestamp_from_time [1958-08-18] (time_col) |
| タイム・スタンプ _from_timet | (timet_col (int32)) | タイム・スタンプ | time_t からタイム・スタンプを返します。 ソース・フィールドには、UNIX time_t 表記で定義されているタイム・スタンプが含まれている必要があります。 | timestamp_col:timestamp = timestamp_from_timet (timet_col) |
| タイム・スタンプ _from_ustring | (string_col (ustring)) | タイム・スタンプ | ustring からタイム・スタンプを返します。 | timestamp_col:timestamp = timestamp_from_ustring (string_col) |
| タイム・スタンプからのタイム・スタンプ | (tstamp_col (timestamp)) | int32 | タイム・スタンプから time_t を返します。 宛先列には、UNIX time_t 表記で定義されたタイム・スタンプが含まれます。 | timet_col:int32 = timet_from_timestamp (tstamp_col) |
| uint64_from_decimal | [r_type, fix_zero] (dec_col (decimal)) | uint64 | Uint64 (10 進数)。 | int_col:uint64 = uint64_from_decimal [ceil, fix_zero] (dec_col) |
| uppercase_string | (string_col (string)) | ストリング | ストリングをすべて大文字に変換します。 変換では英字以外の文字は無視されます。 | string_col:string = uppercase_string (instring_col) |
| uppercase_ustring | (string_col (ustring)) | ustring | ustring をすべて大文字に変換します。 変換では英字以外の文字は無視されます。 | ustring_col:string = uppercase_ustring (string_col) |
| u_raw_from_string | (string_col (ustring)) | ロー | ustring から raw を返します | raw_col:raw = u_raw_from_string (string_col) |
| ustring_from_date | (date_col (date)) | ustring | 日付から ustring を返します。 | string_col:ustring = ustring_from_date (date_col) |
| ustring_from_decimal | (dec_col (decimal)) | ustring | 10 進数から ustring を返します。 | string_col:ustring = ustring_from_decimal (dec_col) |
| ustring_from_string | (string_col (string)) | ustring | ストリングから ustring を返します。 | string_col:ustring = ustring_from_string (string_col) |
| ustring_from_time | (time_col (time)) | ustring | 時刻から ustring を返します。 | string_col:ustring = ustring_from_time (time_col) |
| タイムスタンプからの文字列 | (timestamp_col (timestamp)) | ustring | タイム・スタンプから ustring を返します。 | string_col:ustring = ustring_from_timestamp (timestamp_col) |
| ustring_length | (string_col (ustring)) | int32 | ustring の長さを返します。 | length_col:int32 = ustring_length (string_col) |
| u_substring | [startPosition,len] (string_col (string)) | ustring | ストリング抽出を行って長い ustring を短い ustring に変換します。 startPosition は、サブストリングの開始位置を指定します。len はサブストリングの長さを指定します。 startPosition が正の場合は、ストリングの先頭からのバイト・オフセットをストリングに指定します。 startPosition が負の場合は、ストリングの終わりからのバイト・オフセットを指定します。 | shorstring_col:ustring = substring [5,10] (longstring_col) |
| weekday_from_date | [originDay] (date_col (date)) | int8 | 日付からの曜日。 originDay は、 週のゼロ日目となる曜日を指定するストリングです。 この曜日は、曜日名の先頭 3 文字、あるいは、完全な曜日名を使用して指定できます。 省略した場合、開始曜日として Sunday が定義されます。 originDay は、単一引用符または二重引用符で囲むことができます。また、引用符を省略することもできます。 | dow_int:int8 = [mon] (date_col) |
| year_day_from_date | (date_col (date)) | int16 | 日付からその年の何日目かを返します (戻り値: 1 から 366)。 | doy_col:int16 = year_day_from_date (date_col) |
| year_from_date | (date_col (date)) | int16 | 日付から年を返します。 | year_col:int16 = year_from_date (date_col) |
| year_week_from_date | (date_col (date)) | int8 | 年の何週目かの日付。 | week_col:int8 = year_week_from_date (date_col) |
table_definition は、ストリングのルックアップ・テーブルの行を定義し、以下の形式があります。
{propertyList} ('string' = value; 'string' = value; ... )
ここで、それぞれ以下のとおりです。
- propertyList は以下の 1 つ以上のオプションです。リスト全体が中括弧で囲まれており、複数のプロパティーがある場合はコンマで区切られます。
- case_sensitive. ストリングのマッチングの際、大/小文字を区別して検索を実行します。デフォルトでは、大/小文字を区別しません。
- default_value = defVal. 表内のどのストリングにも一致しないストリングに対して 返されるデフォルトの数値です。
- default_string = defString. 表内のどの数値にも一致しない数値に対して返 されるデフォルトのストリングです。
- string は、値に関連付けられたストリングのコンマ区切りリストを指定します。各ストリングは引用符で囲みます。
- value は、string に関連した 16 ビットの整数値のコンマ区切りリストを指定します。
date_format は、標準の日付形式ストリングです。
R_type は、丸め型を表すストリングで、以下のいずれかを含む必要があります。
- ceil。 ソース・フィールドを正の無限方向に丸めます。 例: 1.4 -> 2, -1.6 -> -1.
- floor。 ソース・フィールドを負の無限方向に丸めます。 例: 1.6 -> 1, -1.4 -> -2.
- round_inf。 ソース・フィールドを最も近い表現可能な値に四捨五入します。5 の値の場合、正の値は正の 無限方向に、負の値は負の無限方向に丸めます。 例: 1.4 -> 1, 1.5 -> 2, -1.4 -> -1, -1.5 -> -2.
- trunc_zero. 符号に関係なく、宛先でサポートされている右端の小数桁より右の小数桁をすべて切り捨てます。 例えば、宛先が整数の場合は、すべての小数桁が切り捨てられます。 宛先が 10 進数でスケールが現在より小さい場合、宛先の 10 進数のスケール・サイズに合わせて丸めるか、切り捨てます。 例: 1.6 -> 1, -1.6 -> -1.
すべてがゼロで構成される列 (デフォルトでは無効) が値にゼロを持つ有効な 10 進数として扱われるように、ソースの 10 進数列に fix_zero を指定できます。
アドバンスト
このセクションでは、以下を指定できます。
- 実行モード。 このステージは、パラレル・モードまたは順次モードで実行できます。 パラレル・モードでは、入力データは、構成ファイルで指定されている使用可能なノード、および「拡張」 セクションに指定されたノード制約によって処理されます。 順次モードでは、データ・セット全体がコンダクター・ノードで処理されます。
- 組み合わせ可能モード。 これはデフォルトで「自動」になっています。これにより、 IBM DataStage は、並列ステージの基礎となるオペレーターを結合して、このタイプのステージで適切な場合に同じプロセスで実行できるようにします。
- パーティションの保持。 このデフォルトは「セット」です。 「セット」または「クリア」を明示的に選択できます。 「セット」を選択して、次のステージがパーティションの維持を試みるように要求します。