Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Extraction string before special character (slash)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Extraction string before special character (slash)
 Login/Join
 
Member
posted
Hello,
I 'm looking forward to extract the string before special character (slash)
Example : adF/France SAS
222/ kidle

  • adF/France SAS
  • 222/ kidle

    I would like only =>
    adf
    222

    WF V8.2

    This message has been edited. Last edited by: FP Mod Chuck,


    WebFocus V8.2.03M
  •  
    Posts: 12 | Registered: April 09, 2019Report This Post
    Guru
    posted Hide Post
    -SET &PARAM = 'adF/France SAS';
    -SET &FIRSTTOKEN = TOKEN(&PARAM.QUOTEDSTRING,'/',1);
    -TYPE &FIRSTTOKEN  


    Test: WF 8.2
    Prod: WF 8.2
    DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
     
    Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
    Virtuoso
    posted Hide Post
    Hi Guilaine

    Welcome to Focal Point I think you will find it an excellent forum for getting answers to your development questions..

    Frans example shows how to do this based on the value being in a parameter. It can also be done when the values are in a database field by using the DEFINE of the new field and using the TOKEN function and referencing the field with the slash.


    DEFINE FILE whatever
    NOSLASH/A10=TOKEN(SLASH_FIELD,'/',1);
    END


    Thank you for using Focal Point!

    Chuck Wolff - Focal Point Moderator
    WebFOCUS 7x and 8x, Windows, Linux All output Formats
     
    Posts: 2128 | Location: Customer Support | Registered: April 12, 2005Report This Post
    Gold member
    posted Hide Post
    Try the function GETTOK ;

    GETTOK(source_string, inlen, token_number, 'delim', outlen, output)


    WebFOCUS 8
    Windows, All Outputs
     
    Posts: 70 | Registered: May 26, 2017Report This Post
    Expert
    posted Hide Post
    Hi Guilaine,

    I would strongly suggest you check out the documentation on Functions.


    Waz...

    Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
    In Focus since 1984
    Pity the lost knowledge of an old programmer!

     
    Posts: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
    Member
    posted Hide Post
    Thank you everybody. with Fonction TOKEN : It's Good. Smiler


    WebFocus V8.2.03M
     
    Posts: 12 | Registered: April 09, 2019Report This Post
      Powered by Social Strata  

    Read-Only Read-Only Topic

    Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Extraction string before special character (slash)

    Copyright © 1996-2020 Information Builders