Focal Point
[SOLVED] ALPHA to INTEGER

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8707037616

February 16, 2012, 09:58 AM
ChristianP
[SOLVED] ALPHA to INTEGER
Hi,
i have an alpha field with numeric values and i want to change it to integer. I searched inside the forum and found nothing that fits.
Regards

Christian

This message has been edited. Last edited by: ChristianP,


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
February 16, 2012, 10:15 AM
j.gross
A good starting point, before appealing for assistance, is a Google search.

Try "webfocus function alpha to numeric"


- Jack Gross
WF through 8.1.05
February 16, 2012, 10:24 AM
<JG>
Christian, EDIT does a straight cast betweenalpha and integer
February 16, 2012, 10:56 AM
Venkat-
Hi Christian,

Here is the code:

DEFINE FILE XXXXXXX
DEF_FIELD1/D12.2=ATODBL(source_string, length, output)
END

TABLE FILE XXXXXXX
SUM
DEF_FIELD1/I10
BY PERSON_ID
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END

The above procedure would change your alpha field to Double-Precision Format (in define statement)
and then while summation /I10 would change the format from double to integer.

I hope this is what you're trying to accomplish!

This message has been edited. Last edited by: Venkat-,


product release:8203
o/s: windows 10
expected o/p formats: HTML,EXCEL,PDF
February 16, 2012, 02:47 PM
Waz
Christian,

What is the format of the alpha field ?

Some of the suggestions above will work, but depends on the content.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 17, 2012, 02:50 AM
ChristianP
Hi Waz,

i took Venkat-,s proposal. Works good for me!!

Regards

Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
February 17, 2012, 05:12 AM
Ian Dalton
Christian, You could just do this in a DEFINE...
I_AFIELDNAME/I9 = EDIT(AFIELDNAME);
where AFIELDNAME is A9


_______________________
*** WebFOCUS 8.1.05M ***
February 19, 2012, 03:44 PM
Waz
quote:
i took Venkat-,s proposal. Works good for me


I assume that your alpha number wasnot formatted.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!