Inserting Data into single comma seperated row
Posted: Fri May 26, 2006 4:29 am
I have a job that creates an output line set to VarChar 1000 and which is comma seperated. And example of 2 rows is shown below.
The '5' is the Record Type and the 2nd value (16083, 16222) are the Key fields that all the following score types and values relate to.
Is it possible to carry out checks on each field within the row and to insert values in, if there is nothing there ? For example, in row 1 I would want to place EAD after the second comma and then a 'space' after the 3rd comma.
I have been looking at the substring function on help to check for a specified field but cannot seem to get it to work.
Any ideas ???
As you can see from the second row, there is a value of EAD (Score Type Code) and it's related value (000000000000000010). In row one, this is missing as the data is not currently within the DB2 table I am extracting the data from.5,16083,,,LGD,0079.1200
5,16222,EAD,000000000000000010,LGD,0094.5300
The '5' is the Record Type and the 2nd value (16083, 16222) are the Key fields that all the following score types and values relate to.
Is it possible to carry out checks on each field within the row and to insert values in, if there is nothing there ? For example, in row 1 I would want to place EAD after the second comma and then a 'space' after the 3rd comma.
I have been looking at the substring function on help to check for a specified field but cannot seem to get it to work.
Any ideas ???