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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Parsing string by semicolon

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Parsing string by semicolon
 Login/Join
 
Guru
posted
How can I parse a character field by ;

FOCUS does not seem to like
LAST_NAME/A30 = GETTOK(NAME, 30, -1, ';', 30, LAST_NAME);

These are possible values for the character field NAME

N/A;N/A
FIRST_NAME;N/A
N/A;LAST_NAME
FIRST_NAME;LAST_NAME

I need to divide the NAME field to FIRST_NAME and LAST_NAME field where FIRST_NAME and LAST_NAME field does not contain 'N/A' or ';'

Any help achieving this would be greatly appreciated.

Thank You in advance.


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
Expert
posted Hide Post
Sayed,

I get no problems with this -
FILEDEF NAMEMAS DISK NAMETAB.MAS
FILEDEF NAMETAB DISK NAMETAB.TXT
-RUN

-WRITE NAMEMAS FILE=NAMETAB,SUFFIX=FIX
-WRITE NAMEMAS SEGNAME=SEG1
-WRITE NAMEMAS FIELD=NAME_DATA,,A80,A80,$

-WRITE NAMETAB N/A;N/A
-WRITE NAMETAB FIRST_NAME;N/A
-WRITE NAMETAB N/A;LAST_NAME
-WRITE NAMETAB FIRST_NAME;LAST_NAME
-RUN

TABLE FILE NAMETAB
PRINT *
      COMPUTE LAST_NAME/A30 = GETTOK(NAME_DATA, 30, -1, ';', 30, LAST_NAME);
END
-RUN

What error message are you getting? Is the format of your field variable (AnnV)?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
quote:
COMPUTE LAST_NAME/A30 = GETTOK(NAME_DATA, 30, -1, ';', 30, LAST_NAME);



Thanks Tony! Clear mistake of DEFINE vs. COMPUTE. I was trying trying to do this on DEFINE.


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
Virtuoso
posted Hide Post
Sayed

No mistake between DEFINE and COMPUTE.

If an expression works in COMPUTE, it will work in DEFINE and vice versa.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Sayed,

Are you saying that once you put it into a compute it worked?

As Alan states, there should be no problem with either. Did you have a semi-colon missing on the previous line in your define?

This is why it is important to state the error number (at least) and the message with this type of question.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Tony,

This creation of a Master file on the fly is brill! Never thought of doing this - opens up new possibilities.

Thanks.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Francis,

I do it a lot of the time when I need a particular master for a McGyver type technique or trying to help folks using their data.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Guru
posted Hide Post
OK I think I see the problem.
This is what I was trying

DEFINE FILE USNOTES

TEAMUS/A51 = GETTOK(TEAM, 51, 1, ';', 51, TEAMUS);

END

TABLE FILE USNOTES
PRINT
TEAM
TEAMUS
END

It works fine when you run it but DevStudio GUI tool does not like semicolon on the DEFINE statement. You get a popup window saying "Semicolns are not allowed".


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report 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     Parsing string by semicolon

Copyright © 1996-2020 Information Builders