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     [SOLVED] String searches

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] String searches
 Login/Join
 
Member
posted
I am looking for someone to help me out on string searches. I am looking to pull strings out of a log file where I could have multiple key text of 'Quality Code:'. I need to find and extract all the text for each Quality Code. I can find the first one easy enough with a POSIT function but if there are more in the log how do I find them or where they begin.

Here is a same of what is in the log:

[Quality Code entered by Cole, Lisa at 02/06/08 10:42 Quality Code: Incomplete/Inaccurate Detail Comments: TTS/AMC did not have enough Details in Description to know what issue is. They did not know what Webform Team workgroup - informed CSC-Wobform and assigned to them. ---------------------------------------------------------------------------------------------------- Quality Code entered by Rutkowski, David at 02/06/08 09:52 Quality Code: Incorrect Escalation Comments: correction... Informed that this should go to CSC Incident ---------------------------------------------------------------------------------------------------- Quality Code entered by Rutkowski, David at 02/06/08 08:54 Quality Code: Incorrect Escalation Comments: This appears to be mis-directed. It is not a TSS GTS issue. It is a "TSS/AMC Support" issue. ---------------------------------------------------------------------------------------------------- ]


Any ideas would be great.

This message has been edited. Last edited by: Kerry,


Kevin
 
Posts: 13 | Registered: January 15, 2007Report This Post
Virtuoso
posted Hide Post
Given this sample of your log, what would your report look like?


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
I would want to get:
Rec Quality
ID Code
__ __________________________________________
1 Quality Code: Incomplete/Inaccurate Detail
1 Quality Code: Incorrect Escalation
1 Quality Code: Incorrect Escalation

So this record was Quality Coded 3 times.

Any help is greatly appreciated.


Kevin
 
Posts: 13 | Registered: January 15, 2007Report This Post
Expert
posted Hide Post
Look up the PARAG subroutine. That would allow you to break up the entry into multiple lines.

Another technique which would work better in Dialogue Manager would be to use POSIT and SUBSTR, then cut off the stuff you've already processed, move the unprocessed stuff to column 1 and start your loop again at the beginning.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Is this log record all one line or is it a multiline text file? I have a couple of ideas to add to Ginny's but it would very much depend on the answer to this question.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Member
posted Hide Post
All in one field.


Kevin
 
Posts: 13 | Registered: January 15, 2007Report This Post
Member
posted Hide Post
OK so I think I figured some things out. Each Quality code that is added is diliminated by 100 dashes. How do I created a for next loop to extract all the text between the 100 dashes.

Thanks for all your advice.


Kevin
 
Posts: 13 | Registered: January 15, 2007Report This Post
Expert
posted Hide Post
OK, Kevin.

First of all, you have to update your profile signature with your products, releases, and platforms so that we know what you are running.

Secondly, while I could write the code for you, you wouldn't learn anything. So what I would suggest is that you read the Developing Reporting Application manual, chapter 5 in the 7.6 version of the manual, on Dialogue Manager.

You are not going to be able to do the loop in a DEFINE. You are going to have to do a -READ against the log file and parse the snot out of it.

BTW, have you looked at the PARAG subrountine? Wouldn't that help you at all?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
One more thing to look at - it appears that you are trying to create multiple lines of output from a single record. This is the classic case for use of the Macguyver technique. It's a little advanced, but it is described in detail and numerous variations here on the forum and in tech support if you do a search.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Master
posted Hide Post
quote:
parse the snot out of it.


Ginny, This may be way too technical!


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
I've been hanging around a woman from Arkansas and I guess I've been picking up some of her 'colorful' phrases. Music


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Master
posted Hide Post
In that case, don't be surprised when you hear that someone "don't have the sense that God gave a goose!" I think that was my mom's favorite.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
<JG>
posted
You have a file with a totally unknown record length that you cannot read with WebFocus
that you cannot put into DM variables because they will blow all possible limits.

Read the file one character at a time and as Ginny says

quote:
parse the snot out of it.


After all you just need 31 lines of code (and a new master to read the output with WebFocus

FILEDEF LONGPARSE DISK c:\IBI\APPS\BASEAPP\LONGPARSE.FTM (LRECL 1 RECFM F
FILEDEF NEWFILE DISK c:\IBI\APPS\BASEAPP\NEWFILE.FTM (APPEND
-RUN
-SET &LABEL1='';
-REPEAT END1 999999999 TIMES
-READ LONGPARSE NOCLOSE &CHAR.A1.
-IF &IORETURN NE 0 GOTO EXIT;
-SET &TEXT='';
-SET &LABEL2='';
-SET &LABEL1= '&LABEL1.EVAL' | '&CHAR.EVAL';
-SET &LABEL1=IF &LABEL1.LENGTH EQ 14 THEN EDIT('&LABEL1.EVAL','$9999999999999') ELSE '&LABEL1.EVAL';
-IF '&LABEL1.EVAL' EQ 'Quality Code:' GOTO GETTEXT;
-GOTO END1
-GETTEXT
-REPEAT END2 999999999 TIMES
-READ LONGPARSE NOCLOSE &CHAR.A1.
-IF &IORETURN NE 0 GOTO EXIT;
-SET &LABEL2= '&LABEL2.EVAL' | '&CHAR.EVAL';
-SET &TEXT = '&TEXT.EVAL' | '&CHAR.EVAL';
-SET &LABEL2=IF &LABEL2.LENGTH EQ 10 THEN EDIT('&LABEL2.EVAL','$999999999') ELSE '&LABEL2.EVAL';
-IF '&LABEL2.EVAL' EQ 'Comments:' GOTO GOTTEXT;
-GOTO END2
-END2
-GOTTEXT
-SET &TIN=&TEXT.LENGTH;
-SET &TOUT=&TEXT.LENGTH -9 ;
-SET &NEWTEXT= SUBSTR(&TIN.EVAL, '&TEXT.EVAL', 1, &TOUT.EVAL, &TOUT.EVAL, 'A&TOUT.EVAL');
-WRITE NEWFILE &NEWTEXT
-END1
-EXIT
 
Report This Post
Virtuoso
posted Hide Post
quote:
parse the snot out of it


Ginny,

I think that should go on a T-shirt for next year's Summit.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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] String searches

Copyright © 1996-2020 Information Builders