%DEC fucntion in FREE format getting error

I'm getting a size error and don't see why it is happening.  

Thank you for you help.

-dec-error.doc
lynn_harrisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tliottaCommented:
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
lynn_harrisAuthor Commented:
Hi Tom.  All the information is in the attachment.  Thanks
0
tliottaCommented:
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
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

lynn_harrisAuthor Commented:
Thanks, Tom.   For next time.  What would be a better format?  Lynn
0
tliottaCommented:
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
tliottaCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lynn_harrisAuthor Commented:
Thanks
0
lynn_harrisAuthor Commented:
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
tliottaCommented:
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
lynn_harrisAuthor Commented:
Good points.  Hmmm...  thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.