Nifty function required

Latimer, Richard richard.latimer at airways.co.nz
Thu Dec 15 13:52:36 CST 2005


Fernando,
 
If you are prepared to fool with your dictionary (and I'm not that brave so have tested with the default '¬' character)  try this:
 
Redefine the substitution character to be a comma 
 
then use the substitute function as below 
 
acc flight_data                                   
def test1 char*10 = "1¬234¬567"                   
def test2 char*10 = substitute(test1,"","","")    
def test6 num*10 = nconvert(test2)                
rep test1 test2 test6                             

 
 
 TEST1       TEST2          TEST6    
                                     
 1¬234¬567   1234567         1234567 
 1¬234¬567   1234567         1234567 
 1¬234¬567   1234567         1234567              
 
 
 
good luck !!
 
regards
Richard Latimer 
MIS Manager 
Airways New Zealand 

                             

  _____  

From: powerh-l-bounces+richard.latimer=airways.co.nz at lists.sowder.com [mailto:powerh-l-bounces+richard.latimer=airways.co.nz at lists.sowder.com] On Behalf Of fernando.olmos at hpa.com.au
Sent: Thursday, 15 December 2005 7:01 p.m.
To: powerh-l at lists.sowder.com
Subject: Nifty function required



Hi gang, 

To save me re-inventing the wheel (and I won't take the credit - I promise!), I need a set of defines that will strip off comma characters "," from a field with numerics.

i.e.    def a char*10 = "1,234" 
        def b = ncon(a) 
        rep b 

this gives ZERO 

obviously, what I need is to report... 1234 and not 0. 

I can do it with ten defines and later concatenating them into a single define, then later converting that to a numeric, but there could be a "one line" solution?      ;)

Thanks 

Fernando Olmos 
MIS 
Senior Analyst Programmer 

HPA
Direct:  03 9217 5411
Mobile: 0410 382 857
Fax:     03 9217 5716 

www.hpa.com.au <file:///H:/Appdata/Microsoft/Signatures/www.hpa.com.au>  


**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and intended
solely for the use of the individual or entity to whom they are addressed.  If
you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
then delete  the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************

**********************************************************************
This electronic message together with any attachments is confidential. If
you receive it in error: (i) you must not use, disclose, copy or retain
it; (ii) please contact the sender immediately by reply email and then
delete the emails. Views expressed in this email may not be those of the
Airways Corporation of New Zealand Limited
**********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20051216/47bb5beb/attachment.htm


More information about the powerh-l mailing list