The EDIT function can be used to
1. Convert the format of the field from numeric to alpha and
2. Extract characters from or insert characters into an alphameric string.
My WebFOCUS 5.2 documentation shows the following examples:
DEFINE ALPHAPRICE/A8 = EDIT(PRICE);
This copies the data and changes the format. The sign, decimal point, and any number to the right of the decimal point go away. The result is right-justified in the output field which is then zero-filled.
DEFINE EMPIDEDIT/A11 = EDIT(EMPID,'999-99-9999');
This takes a nine byte field and with the mask converts it tio an eleven byte field with two hyphens maikng it look like a US Social Security Number (SSN).
To ignore characters in the input field, use the dollar sign ($) in the mask.
HI
THanks for the answer but I need to separate fiels with blanck not - . I would like to display the amont 285656357 like this 285 656 357 (with blank)
breyt
Do the edit function and then replace the commas with spaces using the string funtion and then store it to a alpha numberic field , think this would help you .
The first parm is the length in characters of the character string or a field that contains the length.
The second parm is field or variable that contains the character string OR the string itself enclosed in single quotes.
The third parm is the ASCII or EBCDIC decimal value of the character to be translated.
The fourth parm is the ASCII or EBCDIC deciaml value of the character to be used as a substitue for INT2 in this case.
The fifth parm is the name of the field that contains the result OR the format of the output value enclosed in single qutes. In DM, you must specify the format. In MAINTAIN, you must specify the name of the field.
The ASCII or EBCDIC decimal equivalents can be found in a character chart.
There are probably a number of more elegant solutions to your challenge but this should work.
HTH
Why not use the EDIT function, and, in the mask, place spaces, rather than dashes? Any character in a mask, not a '9' or '$', is inserted into the resultant field. In the prior example, it might look like:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.