Stripping characters out of fields

SBaillie Sherry@mbfoster.com
Wed, 6 Oct 1999 13:23:00 -0400


Jayson,  I've recently had to break out a number of values, separated by ','
from a free text field.  If someone doesn't come up with an easier solution,
you can modify the enclosed sample code to use your '#'.  

The following code looks at the field PRODUCTS and breaks out values found
between   the character specified which in my case was a comma. 

 

request PRODUCT3
access *sfpamus

def COMMA1 num*02 = INDEX(PRODUCTS, ",")
def PROD1 char*20 =  PRODUCTS[1:COMMA1 -1]

def PROD2A char*20 =  PRODUCTS[COMMA1 +1:20]
def COMMA2 num*02 = INDEX(PROD2A, ",")
def PROD2 char*20 =  PROD2A[1:COMMA2 -1]

def PROD3A char*20 = PRODUCTS[COMMA1 + COMMA2 +1:20]
def COMMA3 num*02 = INDEX(PROD3A, ",")
def PRODUCT-CD char*20 = PROD3A[1:COMMA3 -1]

select if PRODUCT-CD ne " "

subfile SFPAMUSP append include SFPAMUS, PRODUCT-CD


Best of luck,

Sherry Baillie 
Services Specialist 
M.B. Foster Associates Limited 
<http://www.mbfoster.com> 


-----Original Message-----
From: Jayson Garrett [mailto:Garrett@mc.edu]
Sent: October 6, 1999 1:06 PM
To: powerh-l@lists.swau.edu
Subject: Stripping characters out of fields


Hi folks...

I'm going to be extracting some information to a non-PowerHouse system
which can potentially have trouble if certain special characters (mainly
the # sound) appear in the data.

What's the best way to strip # characters out of data using PH?

My platform is MPE/iX 5.5, PowerHouse 7.09.E. I'll be extracting the
data using QTP.

Thanks for any suggestions!

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Jayson T. Garrett, Mississippi College Computer Center
P.O. Box 4056, Clinton, MS 39058
601.925.3826   garrett@mc.edu   http://www.mc.edu/~garrett 

"The human race is divided into two sharply differentiated and
mutually antagonistic classes -- a small minority that plays with
ideas and is capable of taking them in, and a vast majority that
finds them painful, and is thus arrayed against them."
    -- H.L. Mencken

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.