Focal Point
[SOLVED] Leading zeros in Alpha

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

October 17, 2012, 09:25 AM
ChristianP
[SOLVED] Leading zeros in Alpha
Hi Focals,

how can i remove leading zeros in an alpha field?? Sometimes i have one, or two or three leading zeros. And i can't compare this with another alpha field. I know numbers in alpha is not so smart, but i can't change the data structures.

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
October 17, 2012, 09:36 AM
Don Garland
-SET &AF = '000123456';

-SET &NEWAF  = GETTOK(&AF,&AF.LENGTH,1,'0',&AF.LENGTH-1,'A&AF.LENGTH');




WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL
October 17, 2012, 09:38 AM
Mighty Max
Use the TRIM function. It's documented in the Help file of Developer Studio. You can also take a look at the documentation online. TRIM is listed under Character Functions of the Using Functions documentation. http://ecl.informationbuilders...ns/source/opener.htm


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
October 22, 2012, 02:38 PM
EricH
If you are absolutely certain that your &var is numeric, you can use the INT function.

EricH
October 23, 2012, 04:19 AM
Baillecl
All this platinum around such a basic question.
Does this metal turns devaluated ?
As a tin member I'd like to remind TOTONUM/I5 = EDIT (TOTO);( If not numeric ---> 0; TOTO should not be Longer than ??? characters )
Any way, I reread TRIM, and thank you for this efficient advice
Cordially (but not so much) and Focusely


Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
October 23, 2012, 04:39 AM
ChristianP
Hi Baillecl,
i think the amount of entries, says nothing about the skill level in WEBFOCUS. As a german proverb says "there are no stupid questions, only answers". Anyway thanks to all Focals, my problem is solved. That is the reason for joining the forum.

Thanks

Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
October 23, 2012, 04:46 PM
susannah
nb: perhaps b/c EDIT won't translate to SQL.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 24, 2012, 08:34 AM
GamP
quote:
there are no stupid questions, only answers

Actually, there are stupid questions. They are the ones that do not get asked ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988