Solved

%DEC fucntion in FREE format getting error

Posted on 2010-08-18
10
634 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
 

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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now