Link to home
Start Free TrialLog in
Avatar of knamc99
knamc99

asked on

URGENT!! DT_STR Expression not working correctly

I have a derived column in SSIS and I am using the following expression:

Derived Column is "SERVER_CODE" Expression  (DT_STR,1,1252)(UPPER(SUBSTRING(@[User::varRxFile],108,1)))

My Variable pulls the file name from a FOR LOOP Sequence,  the Filenames are as follows:

Server_A_RX_IN_20160101.txt
Server_B_RX_IN_20160101.txt
Server_C_RX_IN_20160101.txt

So the Server_Codes need to go to my table as A, B, C  currently it is returning "R" for all files???  

New to expressions using 1252 code page
Avatar of David Todd
David Todd
Flag of New Zealand image

Hi,

At a guess, and not sure which r the expression is picking up, but might need to adjust the 108 I the substring expression.

HTH
  David
Avatar of knamc99
knamc99

ASKER

I don't know what the 108 means?  I have adjusted it,  just randomly and I got Characters not in the file name?
What are the actual varRxFile values because none of those you posted has 108 characters which would result in an error or NULL value with the ones you listed?
Avatar of knamc99

ASKER

Those file names are what the varRXFile is??  At the most 2 bits per character, I am thinking 46 at the most??  I am new to the substring expressions.  

The strange thing is it has been working fine until today??  Files name formats haven't changed or the variable,  so I am pretty stumped?
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of knamc99

ASKER

I am doing testing and changed the directory that the files is residing in.
Avatar of knamc99

ASKER

Thank you,  when I moved the file to the new directory that is what is was. The connection for the file was fully qualified.