Setup:
Pulling in CSV to sequential file, record delim is UNIX. When I view data with the seq definition everything looks good. I then put the data through into a transformer stage which look at the last column of the sequential file. I used the following function in a stage variable:
If Trim(mylink.col1) = "-" Then "0.00" Else Convert('%','',mylink.col1)
Then use the stage variable directly into a column derivation.
After this for some reason the output of the transformer this column contains a space at the end. I tried to remove this space by trimming it but it still remains. I have no idea why this is happening. There is no spaces at the end of this column coming into the transformer stage ( I checked through a peek stage). This is causing issues when I then use a StringtoDecimal function after because it's seeing this trailing character. any help here would be appreciated.
Edit: I can also confirm even if I map the input column directly to an output column I am still getting a trailing space at the end. This shouldn't be happening I don't see the character existing at all in the sequential file view data, or directly from a peak stage from the sequential file. Also when I LEN function on this column it is saying there is an extra character... but I can't trim it and it appears to be a space.
Trailing end character
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 48
- Joined: Wed Jan 07, 2015 3:30 pm
It Is Varchar. Everything is set to varchar (stage var, input, output) for now just to get this portion fixed first. So, also I made a copy of the job deleted the transformer stage. Added a new one in, mapped to it did input to output and no characters were added. Once I used the conversion functions, trailing spaces started to show up again.
-
- Premium Member
- Posts: 48
- Joined: Wed Jan 07, 2015 3:30 pm