checknumericThis is a featured page

Checks a string only contains allowable values and converts the digital and decimal portions into numeric variables.

Arguments:
NumberTypeRequired or OptionalDescriptionMinimum
Length
Maximum
Length
Minimum
Decimals
Maximum
Decimals
1AlphaRequiredString to be converted 1256

2NumericOptionalMaximum number of integers allowed
Range: 0 - 63 Default: 15
1300
3NumericOptionalMaximum number of decimals allowed
Range: 0 - 63 Default: 9
1300
4AlphaOptionalList of allowable characters to be ignored e.g. $, %, C, R150


Return Values:
NumberTypeRequired or OptionalDescriptionMinimum
Length
Maximum
Length
Minimum
Decimals
Maximum
Decimals
1NumericRequired Return integer portion 1Unlimited00
2NumericOptionalReturn decimal portion 1Unlimited1Unlimited
3AlphaOptionalReturn okay code (Y/N) 11

4AlphaOptionalReturn sign of the number (+ or -)11

5NumericOptionalReturn number of integers13

6NumericOptionalReturn number of decimals1300


RDML Example:
To get a packed decimal 9,2 result field #P92 from an alphanumeric field #A using 2 intermediate work fields called #P90 and #DEC.
DEFINE FIELD(#P92) TYPE(*DEC) LENGTH(9) DECIMALS(2)
DEFINE FIELD(#P90) TYPE(*DEC) LENGTH(9) DECIMALS(0)
DEFINE FIELD(#DEC) TYPE(*DEC) LENGTH(2) DECIMALS(2)
...
USE BUILTIN(CHECKNUMERIC)WITH_ARGS(#A72) TO_GET(#P90#DEC)
CHANGE FIELD(#P92)TO('#P90+#DEC')


petewood
petewood
Latest page update: made by petewood , Oct 28 2008, 8:29 AM EDT (about this update About This Update petewood reformatted table - petewood

6 words added
2 words deleted

view changes

- complete history)
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)