×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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

source is .c3 files-to convert amounts in format "s9(7)v99"

source is .c3 files-to convert amounts in format "s9(7)v99"

source is .c3 files-to convert amounts in format "s9(7)v99"

(OP)
I have source as .c3 files,in that we have amounts column where data in that is in format"s9(7)v99"
and sample data is as below
Amount- 00799{00000{
hint is given as below
Values are formatted using COBOL "signed overpunch" codes
and link given is http://en.wikipedia.org/wiki/signed overpunch

What transformation & logic to be used to convert these into amount ??
kindly help

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

If it's as straight-forward as the link states, then you can look at the last character and change that to the proper one using a decode function. You will also need to pick up the sign from that. Note that this format has an implied decimal point before the last two digits.

Your example doesn't seem to fit the format. The leading s means there could be a sign, then there should be 7 digits before the implied decimal point and two more after. The '9' usually means a digit is required, but I could be wrong.

"I think we're all Bozos on this bus!" - Firesign Theatre jester

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

(OP)
format S9999999v99 signed overpunch,in my requirement it is given so
and they have given a link
http://en.wikipedia.org/wiki/Signed_overpunch
to use this link & convert

What logic is to be followed to convert
here is an example data
"00000085A" so we have several different values like this
"00000799{"
so we cannot know which value is coming while we use it in transformation.
These values are given under Amount field
so,how each n every sign be converted,it will be of great help if you can provide the logic

Thanks in Advance
 

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

You will need a number of variables to do this.
variable name - type - expression:
last_char_v - string - substr(amount,9,1)
sign_v - integer - iif(instr('{ABCDEFGHI') > 0,last_char_v),1,-1)
last_char_converted_v - string - decode(last_char_v,'}',0,'J',1,'K',2,... (fill in the rest from the table in the link),'I',9)
new_amount_v - double - sign_v*to_float(substr(amount,1,7)) + to_float(substr(amount,8,1))*.1 + to_float(last_char_converted_v)*.01
 

"I think we're all Bozos on this bus!" - Firesign Theatre jester

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

(OP)
Thank you so much for the logic

You have done a great help for me

 

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

How about showing your appreciation with a star!

"I think we're all Bozos on this bus!" - Firesign Theatre jester

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

(OP)
sorry that i forgot to give star yesterday

I have given it today

once again Thanks for your help  

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

smile

No problem. It was a good challenge.

"I think we're all Bozos on this bus!" - Firesign Theatre jester

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

(OP)
Can we Implement Mapplet for this logic,i haven't used mapplet before.

So, there are many amount fields like dedamt,totamt,lifetimeamt etc for all those fields we should convert signed over punch values

Can it be implemented using mapplet or should we proceed to
with converting each fiels using above logic
 

RE: source is .c3 files-to convert amounts in format "s9(7)v99"

Yes, you can use a mapplet. Or a shared transformation. Either should do the trick. Then just copy it in so you have one for every field you want to convert.

"I think we're all Bozos on this bus!" - Firesign Theatre jester

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