KB Article 9831

Contact Tech Support

 Email Tech Support
 (250) 655-1766
 [7:30 - 5:00 PST]
Your Meeting ID will be Provided by a Rep.
Tech Support
Tech Support Home
Software Updates
Knowledge Base Search
Recent KB Articles
Product FAQs
Code Samples
Tech Blog
System Requirements
Installation Instructions
Support Testimonials
Contact us to...
Create a Ticket
Request a Free Demo
Suggest a New Feature
Submit Feedback
Upload a Large File
Other Services
Software Training
Professional Services

I need to create a shorter version or substring over a ridiculously long numeric field, and display the result in my subfile. How can I do this?

Product: ProGen Plus Type: Frequently Asked Question

Sometimes our databases, for reasons beyond our ken, include numeric fields that are absurdly large - like 25,2 for example. While with the way the US currency is losing ground on the global economy it's true that we could soon be looking at paying a trillion dollars for a loaf of bread, for now you may be content with your subfile just displaying the first billion or so dollars of an amount.
There are a couple of strategies you can pursue:
  • Use a *SUBSTRING work field.The advantage of the *SUBSTRING is that you don't have to add any Actions, and the disadvantage is that you have to use an Edit Word to get the formatting done, and the Edit Word may not handle negative values. The catch is that you have to define the substring over the *last* bit of the field, not the first (e.g. starting at position 13, and 12 long). Create your *SUBSTRING by typing &w on the subfile, in the location where you want to add the field.
  • Use a *PANEL work field. The advantage off using a *PANEL field is that you can specify the length AND decimals when you define the field, and you can use a simple Edit Code J for the formatting. The downside is that you also need to add an UPDFLD action at *S1LD to move the value from the database field.
There may be other strategies too, like using a *RESULT work field with smaller dimensions, that multiplies your database field by 1, but we didn't test that one.

Rate This Article

Did this example help you to achieve your goal?
 Yes  No  Don't Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

Email Address:
Please enable JavaScript in order to rate this page.