Assigning Column value from previous row column value
Posted: Fri Sep 22, 2006 7:46 am
Hi All,
I struck up doing a job here. I have a data file in the following format.
LOC DEPT STOCK
10, 1, 10
, 2, 20
, 3, 15
, 4, 15
20, 5, 10
, 8, 15
, 12, 12
30, 25, 15
, 30, 15
I have to assign the LOC '10' to the 2nd,3rd,4th records and LOC '20' to the next two records and 30 to the next record. Can any one help me in doing this job.
The ouput of the job should be
LOC DEPT STOCK
10, 1, 10
10, 2, 20
10, 3, 15
10, 4, 15
20, 5, 10
20, 8, 15
20, 12, 12
30, 25, 15
30, 30, 15
I appreciate your time and help in advance
Thanks
Lotus
I struck up doing a job here. I have a data file in the following format.
LOC DEPT STOCK
10, 1, 10
, 2, 20
, 3, 15
, 4, 15
20, 5, 10
, 8, 15
, 12, 12
30, 25, 15
, 30, 15
I have to assign the LOC '10' to the 2nd,3rd,4th records and LOC '20' to the next two records and 30 to the next record. Can any one help me in doing this job.
The ouput of the job should be
LOC DEPT STOCK
10, 1, 10
10, 2, 20
10, 3, 15
10, 4, 15
20, 5, 10
20, 8, 15
20, 12, 12
30, 25, 15
30, 30, 15
I appreciate your time and help in advance
Thanks
Lotus