Advertisement

04.24.2008 at 09:37AM PDT, ID: 23350937
[x]
Attachment Details

Convert a COMP-3 (signed) field to ASCII

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2
Tags:

English :-) (I code in Intersystems Cache)

I am having problems unpacking this data (I've attached sample file).  
This code (below) works on another clients file - but is NOT returning the correct data for this data(attached) from another client. I've been all over the internet and most sites refer to utilities or internal functions within whatever language they're using.  (I've reviewed the Documentation for my language (Cache) -- and it seems there is a function ($ZWUNPACK) -- but it's not working for me.

 I'm hoping for two things with this question: 1. For the experts to be able to take a look at my data and 'see' what I'm missing and 2. For them to then be able to tell me how to convert this data to Ascii.

File layout:
INVNO pos 1-9
INVDT COMP-3 pos 10-13
INVAMT COMP-3 pos 14-18
AMTDUE COMP-3 pos  19-23
--------------------------------------------------------------------------------------------------------
I've added comments and spelled out the commands for readability

BIN(G) ; Convert Binary
 New Y,J,K
Set Y=""
 For J=1:1:$Length(G) Do
 .Set CVT=$Ascii($Extract(G,J,J)  ;Extract(from,startpos,endpos)
 ; \ = divides and drops remainder     # = divides and returns the fractional remainder
 .Set K=(CVT\16_CVT#16)
 .Set Y=Y_K
 .Quit:$Length(K)<2 ;quits DO and loops back up
 Quit Y ;Quits function returning Y
Attachments:
 
sample with COMP-3 fields
 
Answered By: SRG041808
Expert Since: 04/18/2008
Accepted Solutions: 2
Computer Expertise: Beginner
SRG041808 has been an Expert for 8 months, during which he has posted 9 comments and answered 2 questions. SRG041808 is just one of 31 experts in the InterSystems Cache Zone. 1 expert collaborated on this answer, which was graded an "A" by the asker.
 
 
 
 
20081119-EE-VQP-47 / EE_QW_2_20070628