How to: |
The SPLIT function returns a specific type of element from a string. The output is returned as variable length alphanumeric.
SPLIT(element, string)
where:
Can be one of the following keywords:
Alphanumeric
Is the string from which the element will be extracted.
The following request defines strings and extracts elements from them.
DEFINE FILE WF_RETAIL_LITE STRING1/A50 WITH COUNTRY_NAME= 'http://www.informationbuilders.com'; STRING2/A20 = 'user1@ibi.com'; STRING3/A20 = 'Louisa May Alcott'; Protocol/A20 = SPLIT(URL_PROTOCOL, STRING1); Path/A50 = SPLIT(URL_PATH, STRING1); Domain/A20 = SPLIT(EMAIL_DOMAIN, STRING2); User/A20 = SPLIT(EMAIL_USERID, STRING2); First/A10 = SPLIT(NAME_FIRST, STRING3); Last/A10 = SPLIT(NAME_LAST, STRING3); END TABLE FILE WF_RETAIL_LITE SUM Protocol Path User Domain First Last ON TABLE SET PAGE NOLEAD END
The output is shown in the following image.