Formatting a number in PowerHouse - version 8.49.E
Ken Langendock
ken.langendock at rogers.com
Tue Sep 1 11:56:34 CDT 2009
There is no fool proof solution unless the string is exactly the same every
time.and from what he said here, this is not the case.
By using INDEX, this solution is relatively easy:
TEMP T-XAmount CHARACTER * 20
ITEM T-XAmount = Field OF InputFile
; remove 1st ','
ITEM T-XAmount = T-XAmount [INDEX(T-XAmount,',') + 1:20] &
IF 0 NE INDEX(T-XAmount,',')
; remove 2nd ','
ITEM T-XAmount = T-XAmount [INDEX(T-XAmount,',') + 1:20] &
IF 0 NE INDEX(T-XAmount,',')
; remove 3rd ','
ITEM T-XAmount = T-XAmount [INDEX(T-XAmount,',') + 1:20] &
IF 0 NE INDEX(T-XAmount,',')
. etc.
ITEM T-Amount = NCONVERT(T-XAmount)
Ken
From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com
[mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On
Behalf Of Lowe, Chuck J
Sent: August 31, 2009 1:04 PM
To: powerh-l at lists.sowder.com
Subject: [Bulk] Formatting a number in PowerHouse - version 8.49.E
I have a file from an outside vendor. They are sending it pipe delimited
"|", There is an amount field that is left justified. Is there anyway to
take that character field and convert it to a numeric field without doing
INDEX and bit extracts. Sometimes the field is 123.45 and sometimes
3,123.45. I thought I could use the FORMATNUMBER function but that is for
doing the opposite.
The vendor states they can not send it unformatted.
Thanks in advance.
Chuck Lowe Quest Diagnostics | Sr. Programmer/Analyst,SYS Billing
System/Denver| 400 Egypt Rd. | West Norriton, PA 19403 USA | phone
610-650-6679| fax 610-650-2111 |
<mailto:Chuck.J.Lowe at questdiagnostics.com> Chuck.J.Lowe at questdiagnostics.com
| <http://www.questdiagnostics.com/> www.QuestDiagnostics.com
Please think about resource conservation before you print this message
------------------------------------------
The contents of this message, together with any attachments, are intended
only for the use of the person(s) to which they are addressed and may
contain confidential and/or privileged information. Further, any medical
information herein is confidential and protected by law. It is unlawful for
unauthorized persons to use, review, copy, disclose, or disseminate
confidential medical information. If you are not the intended recipient,
immediately advise the sender and delete this message and any attachments.
Any distribution, or copying of this message, or any attachment, is
prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20090901/de04668f/attachment.htm
More information about the powerh-l
mailing list