ここでは DB2 を使用して、iSeries 上のファイル内のデータについて話していました。
ファイル構造は次のとおりです。
Item Textline Text
12755 1 this item
12755 2 is no longer
12755 3 for sale
abc123 1 please use
abc123 2 another code
xyz987 1 obsolete
得ようとしている結果は
Item Text
12755 this item is no longer for sale
abc123 please use another code
xyz987 obsolete
そのため、項目コードごとにグループ化され、テキスト行はいくつあっても合計されます。
ファイルをそれ自体に5回結合して(最大5行のテキスト行がある可能性があります)、最初にクエリで試してみましたが、うまく動作しませんでした。
私はSQLで試しましたが、慣れ親しんだコマンドをテキストで正しく動作させることができず、テキスト行を複製せずにそれらを一緒に追加する基準に苦労しています。
誰でもアイデアはありますか?
私の最後の手段は、このファイルを 5 回抽出して、各ファイルに異なるテキスト行だけを含め、アイテムに基づいてそれらをすべて照合し、そのように連結することです...しかし、それはどれほど面倒です :)
助けてください :)