0

My question is about using "Derived Column Transformation".

Situation:

A row already retrieved from flat file successfully. I am trying to derive multiple columns by using "Derived Column" and substring function. There are as many as 36 columns that I need to derive from the given string. Issue occurs when after deriving first 3 columns from the row, substring() somehow cannot read row or derive further columns.

Input Row: (Total length of each row would be 400 characters)

ANICHOLLS, JASON, ROBERT 19700613136643-590 AB5731 MAIDSTONE CRES NE CALGARY T2A4C3113 GAST A00405860F DRUPDRUMHELLER TSA131(1)(G) 20030520 OPERATE OVERWEIGHT VEH 2007061801055STRSTRATHMORE 00005750{BBB235 AB0020070625 200707191005209

Effort to Derive column: enter image description here trying to see output while debugging

Am I trying wrong syntax here?

7
  • 2
    If you know your column widths, you should change your flat file connection to a fixed-width format and scrap trying to parse out the columns yourself. Use the tools to make your work easier, not more complicated. Oct 2, 2018 at 19:40
  • I agree with @digital.aaron Use the fixed width importer. It will also let you choose the correct data types. However, you should be able to do exactly what you are attempting without any issues. I've done what you are doing only when there are multiple row types. Like Header and details in the same file.
    – KeithL
    Oct 2, 2018 at 19:59
  • I have already used fixed-width format and so it shows me correct number of rows as well while deriving columns from them. @digital.aaron, Can you further elaborate or show reference which tools could I use for easy derivation? Oct 2, 2018 at 20:03
  • 2
    @Binoy here is an example stackoverflow.com/questions/10289640/…
    – KeithL
    Oct 2, 2018 at 20:04
  • @KeithL, +1. your response helped. Just for knowledge, what if the column width is known but values may or may not appear in file to derive particular column! Oct 2, 2018 at 21:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.