Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISPLAY FORMAT

Status
Not open for further replies.

breyt

IS-IT--Management
Dec 9, 2002
66
FR
HI
I have a numeric field 285608 and I would like to display like 285 608 . How with webfocus separate the towthand with blank
Thanks
breyt
 
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.

HTH
 
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 .
 
Okay-
The next step would be the CTRAN (Character Translation) function.

EMPIDBLKS/A11 = CTRAN(INT1,EMPIDEDIT,INT2,INT3,EMPIDBLKS);

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:

EMPIDEDIT/A11 = EDIT(EMPID,'999 999 999');
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top