I'm trying to learn how to use script component. I'm trying to take a value, 'Gender', and then check to see whether it is "M" or "F". If it is M then change value to G and if F then change value to L. My input column is gender and my output column is genderChange I'm just going to have it print to a flat file. I'm aware that there are transformations already built into SSIS but I really want to use script component.
This is my code that I have
Dim arr() As String = Row.Gender.Split(","c)
Dim iReadingCount As Integer = 1
Dim convertVal As String = " "
For i As Integer = 0 To arr.Length - 1
With Output0Buffer
.AddRow()
convertVal = Convert.ToString(Row.Gender)
If (convertVal Is "M") Then
.genderChange = "G"
End If
If (convertVal Is "F") Then
.genderChange = "L"
End If
iReadingCount += 1
End With
Next
Thank you for your help