How to process a condition on 124 occurences of a field?
Posted: Fri Sep 14, 2012 3:50 am
Hi,
My column defintion is as below.
1. Status_1 char(2)
2. Date_1 char(8 )
3. Status_2 char(2)
4. Date_2 char(8 )
.
.
.
247. Status_124 char(2)
248. Date_124 char(8 )
Condition to check: If any of these 124 status field's value is 'AB' or 'CD' or 'EF' then I need to get the corresponding Date field and set the the status as 'XYZ' in the output else Date field should be set to null and Status field should be set to 'ABC'.
For example
1) if the value of the field Status10 is 'CD' then I need map the field Date10 and set the status as 'XYZ' in the output.
2) Otherwise null and 'ABC' should be set in the output.
Any suggestions on how to achieve this?
My column defintion is as below.
1. Status_1 char(2)
2. Date_1 char(8 )
3. Status_2 char(2)
4. Date_2 char(8 )
.
.
.
247. Status_124 char(2)
248. Date_124 char(8 )
Condition to check: If any of these 124 status field's value is 'AB' or 'CD' or 'EF' then I need to get the corresponding Date field and set the the status as 'XYZ' in the output else Date field should be set to null and Status field should be set to 'ABC'.
For example
1) if the value of the field Status10 is 'CD' then I need map the field Date10 and set the status as 'XYZ' in the output.
2) Otherwise null and 'ABC' should be set in the output.
Any suggestions on how to achieve this?