%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?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tliottaConnect With a Mentor Commented:
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
 
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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
 
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
All Courses

From novice to tech pro — start learning today.