hi,
can u please guide me
i have in my source order id previous_orderid original_order_id
51411 - -
51428 51411 51411
51432 51411 51411
this record comes as 1 record i want my curr_flg be 1 on last order id thats 51432
please guide me i am in fix do i have to write some kind of subquery
Thanxs
bobby
order id is changing
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
A quick and dirty way to do this is to make two passes through your file.
Pass 1:
Build a hash file whose primary key is original order id, and its data column is max order id.
Hash
|
| Lookup original order id
V
Seq -----------------> Transform --------------------> Same Hash File
If order id > max order id
from lookup
then update hash row
Pass 2:
Read you file, lookup original order id. If this order id = max order id from lookup, the current indicate is 1 else 0.
Pass 1:
Build a hash file whose primary key is original order id, and its data column is max order id.
Hash
|
| Lookup original order id
V
Seq -----------------> Transform --------------------> Same Hash File
If order id > max order id
from lookup
then update hash row
Pass 2:
Read you file, lookup original order id. If this order id = max order id from lookup, the current indicate is 1 else 0.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
hash file warning
Hi Chuck
when i am writing my original id to hash file as some rows are blank ---
so its giving me error HSHSWWATORDER..Hashed_File_1.DSLink2: ds_uvput() - Write failed for record id '<Missing or NULL>' as i am making orginal id as primary key in hash so should i ignore that error
Thanks,
bobby
when i am writing my original id to hash file as some rows are blank ---
so its giving me error HSHSWWATORDER..Hashed_File_1.DSLink2: ds_uvput() - Write failed for record id '<Missing or NULL>' as i am making orginal id as primary key in hash so should i ignore that error
Thanks,
bobby
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact: