Solved

%DEC fucntion in FREE format getting error

Posted on 2010-08-18
10
635 Views
Last Modified: 2013-12-06
I'm getting a size error and don't see why it is happening.  

Thank you for you help.

-dec-error.doc
0
Comment
Question by:lynn_harris
  • 5
  • 5
10 Comments
 
LVL 27

Expert Comment

by:tliotta
ID: 33471100
Since you haven't supplied any source example, we can't see why either.

We need to see the failing instruction (all of it), as well as the definitions of any variables used in the entire instruction. The actual error message (including the message identifier) might also be needed.

Tom
0
 

Author Comment

by:lynn_harris
ID: 33471139
Hi Tom.  All the information is in the attachment.  Thanks
0
 
LVL 27

Expert Comment

by:tliotta
ID: 33471155
Ah! Now I see the attachment -- it's just not in a format that I can use at the moment. A Word .DOC with embedded images wasn't expected. Just a minute...

Tom
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:lynn_harris
ID: 33471172
Thanks, Tom.   For next time.  What would be a better format?  Lynn
0
 
LVL 27

Expert Comment

by:tliotta
ID: 33471249
Simple answer is that WKPCT can only hold a maximum value of 9.9999. It can't hold 1000, which is what you have in PAPCT.

Just for a debug test, change the value of PAPCT to be '00001' just before the problem instruction fails. WKPCT should result in 1.0000 after the instruction. Then try PAPCT='0.100'; WKPCT should become 0.1000.

The precision and decimal-position values are not used in parsing the character string; they are used in providing the result value. The character string is parsed for exactly what characters are in the string. The definition says that a decimal point is optional in the string -- if one isn't supplied, the value will be an integer value.

Try WKPCT = %dec(PAPCT:5:0)/10000 ;

Tom
0
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
ID: 33471273
Lynn:

Nothing wrong with the document. It was just unexpected. It's unusual for anyone to go to that much trouble. Practically speaking, it was excellent. The attachment area isn't always an "eye-catcher", obviously not for me! I'd have noticed it quicker if the question had mentioned "...in the attachment", but that might say more about me than the question.

Tom
0
 

Author Closing Comment

by:lynn_harris
ID: 33471319
Thanks
0
 

Author Comment

by:lynn_harris
ID: 33471338
Ah... I thought the parsing would use the decimal value when enter.  I am new to free format.  Thank you very much!!

I tend to put in as much info as possible.   Have a great night!
0
 
LVL 27

Expert Comment

by:tliotta
ID: 33471416
BTW, the (...:5:0)/10000 is purely for the actual value that was in the error condition! I suspect that if you think about what %dec() does and how the definition of "function" fits into everything here, you'll see both future possibilities as well as potential snags. E.g., what if PAPCT comes in with the character "01.01"?

Given the error value, you could more easily simply define PAPCT as a 5-digit, 4-decimal zoned field and not use %dec() at all. But then there are other potential errors...

And note that the original question is technically unrelated to /free-form. The coding is essentially the same in fixed format.

Tom
0
 

Author Comment

by:lynn_harris
ID: 33471451
Good points.  Hmmm...  thanks again.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question