[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[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

Convert a COMP-3 (signed) field to ASCII

Asked by SRG041808 in Health Care / MUMPS, Miscellaneous Programming, InterSystems Cache

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
 
 
Related Solutions
Keywords: Convert a COMP-3 (signed) field to…
 
Loading Advertisement...
 
[+][-]04/26/08 04:27 PM, ID: 21447126Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Health Care / MUMPS, Miscellaneous Programming, InterSystems Cache
Tags: English :-) (I code in Intersystems Cache)
Sign Up Now!
Solution Provided By: SRG041808
Participating Experts: 1
Solution Grade: A
 
[+][-]04/24/08 10:18 AM, ID: 21433095Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/24/08 10:49 AM, ID: 21433369Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 / EE_QW_2_20070628