Focal Point
[SOLVED] Alpha Numeric to Number

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

June 21, 2018, 05:23 PM
Tim A
[SOLVED] Alpha Numeric to Number
Can anyone tell me how to convert an alpha numeric value to a number (dec, int, whatever), so i can use that field to sort by in numeric order?

example:

TABLE FILE Z1
PRINT
PRI/A3
NAME/A100
STORY/A8
REQ/A8
REQ_TYP/A2
REQ_DT/MDYY
DUE_DT/MDYY
REQ_BY/A25

BY LOWEST PRI NOPRINT

The PRI/A3 (priority)data ranges from 1 through 310, and sorted this way is recognized as alpha numeric and out of order (by numerical standards)

A3 output 1,100,110,2,220,230 ect....

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.2
June 21, 2018, 05:40 PM
FP Mod Chuck
Tim

Use a DEFINE as below.


DEFINE FILE Z1
PRI_INT/I11 = EDIT(PRI);
END



Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
June 21, 2018, 07:48 PM
Waz
Another option, depending on the contents of the field, is to change the format of the field in the master file.


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!

June 22, 2018, 09:07 AM
Tim A
Outstanding, thanks Chuck


WF 8.2