Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SSIS string conversion 2012

SSIS string conversion 2012

SSIS string conversion 2012

I have a requirement where from a string we need to derive the amount and also based on the alphabet we need to make it negative or positive amount. Here is the string
In this string '0000005335R' is the amount with 2 decimals 000000533.5R
We need to decode A = 1, B= 2 till I = 9 and J = 1 with negative values till S = 9(negative)
so the final output in this string should be:
if the string is '1047383658000012345678990000002014083J354310020140850000005335A0000'
output should be 533.51
if the string is '1047383658000012345678990000002014083J354310020140850000005335S0000'
output should be -533.59

I need expert help on this asap.


RE: SSIS string conversion 2012

looks like Mainframe cobol signed (and S - 9 looks wrong by the way as R = 9)
following link has the possible values, respective replacement number and multiplier.

Easy enough for you to pass the string through a c# convert script within your dataflow, split the string in your components and apply the logic to the right most character.
something like
nibble = right(mystr,1)
num = left(mystr,len(mystr) - 1)
sign = "+"
when nibble = A
then num2 = 1
when nibble = J
then num2 = 1
sign = "-"

final_num = sign + num + num2


Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close