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     reading special fields

Read-Only Read-Only Topic
Go
Search
Notify
Tools
reading special fields
 Login/Join
 
Virtuoso
posted
I have a database that holds among others the next two fields

clientid verylongstring
12345    '991234','993221','914727','936269','939292'
82836    '921438','913432','915347'
82805    '991234','953221','913432','915347','914727','933269','939292'


So in fact the second long field holds several values.

I need to build a report as if the several numbers in the long string are records in a database.

Is it possible to do something like a decode on that string or build a report like

12345    '991234'
12345    '993221'
12345    '914727'
12345    '936269'
12345    '939292'
82836    '921438'
82836    '913432'
82836    '915347'
82805    '991234'
82805    '953221'
etc




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
Try creating a temporary FOCUS file and insert records into it using the MODIFY FILE command along with the FREEFORM statement.
The FREEFORM statement reads comma-delimited data, you'll first have to save your data.

define file xxx
commma/a1 = ',';
endofline = '$';
end

table file xxx
print cliendid comma verylongstring comma endofline
on table save
end

Now use a MODIFY FILE with FREEFORM to read the save file.

Regards,
 
Posts: 13 | Location: Montreal,Canada | Registered: August 22, 2007Report This Post
Expert
posted Hide Post
How about creating a master with OCCURS?

If the original table is an RDBMS, create a HOLD file and then use a different master with OCCURS.

Here's an example:
FILE=HATTRIB          ,SUFFIX=FIX
SEGNAME=HATTRIB
FIELDNAME   =NODE_ID    ,E01         ,P11      ,A11      ,$
FIELDNAME   =WTEXT      ,E02         ,A1560     ,A1560   ,$
SEGNAME=ATTRIB          ,PARENT=HATTRIB,  POSITION=WTEXT,  OCCURS=15
FIELDNAME   =ATTRIB_KEY      ,E04         ,A04     ,A04     ,$
FIELDNAME   =WCOL            ,E05         ,A100    ,A100    ,$
FIELDNAME   =ALINE_NO        ,ORDER       ,I5       ,I5     ,$


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
Guru
posted Hide Post
Isn't this a good example of where to use McGuyver? Split up verylongstring into multiple fields using GETTOK and then use Mcguyver to print them out one over the other.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Master
posted Hide Post
I think this would be nice - if IBI built in MCGUYVER technique directly into wf. The MULTIPLY command would have syntax and usage similar to the JOIN command.

MULTIPLY filename[.segname] n TIMES

This would mean the record retrieved once and then passed n times to the matrix with dummy field filename.segname.MULTIPLE which varied from 1 to n.

This would give wf a lot of extra functionality with a relatively simple implementation.

Once you're done: MULTIPLY CLEAR !
And ? MULTIPLY

I can only dream on...

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



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Member
posted Hide Post
Try the following:

FILE=SPLIT ,SUFFIX=FIX,$
SEGNAME=ONE ,SEGTYPE=S0,$
FIELDNAME =CLIENTID , ,ACTUAL=A5 ,USAGE=A5 , $
SEGNAME=TWO ,SEGTYPE=S0, PARENT=ONE, OCCURS=20 , $ <=== Your maximum value
FIELDNAME = SHORTSTRING , ,ACTUAL=A8 ,USAGE=A8 , $
FIELDNAME = COMMA , ,ACTUAL=A1 ,USAGE=A1 , $

DEFINE FILE UNSPLIT
-*
-* 20 Occurences * 9 bytes + 5 bytes for the Client ID = 185 bytes
-*
TOTALLINE/A185 = CLIENTID | LONGSTRING ;
END

TABLE FILE UNSPLIT
PRINT TOTALLINE
ON TABLE SAVE AS SPLIT
END

TABLE FILE SPLIT
PRINT SHORTSTRING
BY CLIENTID
WHERE SHORTSTRING NE ' '
END

Output Results:

CLIENTID SHORTSTRING
-------- -----------
12345 '991234'
'993221'
'914727'
'936269'
'939292'
82805 '991234'
'953221'
'913432'
'915347'
'914727'
'933269'
'939292'
82836 '921438'
'913432'
'915347'

Good Luck.
 
Posts: 13 | Location: Montreal,Canada | Registered: August 22, 2007Report This Post
Virtuoso
posted Hide Post
This looks great Albert

When I posted my question I thought al the numbers in the longstring where of equal length, but in the meantime I found that they are not, some are 7 and some are 9.
I will try to combine some tips here and see if I will get it work

Thanks




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
If your field lengths are different then try this:

The Input file is as follows:

Client ID Long Value
--------- ----------
12345 '9234','9932','97','936269','939292'
82836 '921438','913432','917'
82805 '991234','953221','912','915347','917','969','939292'

Master file is now (similar to earlier post -- no COMMA field in SEGNAME TWO:

FILE=SPLIT ,SUFFIX=FIX, $
SEGNAME=ONE ,SEGTYPE=S0,$
FIELDNAME = CLIENTID , ,ACTUAL=A5 ,USAGE=A5 , $
SEGNAME=TWO ,SEGTYPE=S0, PARENT=ONE, OCCURS=20
FIELDNAME = SHORTSTRING , ,ACTUAL=A9 ,USAGE=A9 , $

Focexec is:

DEFINE FILE UNSPLIT
GTOK1 /A9 = GETTOK(LONGSTRING,101,1,',',9,GTOK1);
GTOK2 /A9 = GETTOK(LONGSTRING,101,2,',',9,GTOK2);
GTOK3 /A9 = GETTOK(LONGSTRING,101,3,',',9,GTOK3);
GTOK4 /A9 = GETTOK(LONGSTRING,101,4,',',9,GTOK4);
GTOK5 /A9 = GETTOK(LONGSTRING,101,5,',',9,GTOK5);
GTOK6 /A9 = GETTOK(LONGSTRING,101,6,',',9,GTOK6);
GTOK7 /A9 = GETTOK(LONGSTRING,101,7,',',9,GTOK7);
-*
TOTALLINE/A185 = CLIENTID |
GTOK1 | GTOK2 | GTOK3 | GTOK4 | GTOK5 | GTOK6 |GTOK7;
END

TABLE FILE UNSPLIT
PRINT TOTALLINE
ON TABLE SAVE AS SPLIT
END

TABLE FILE SPLIT
PRINT SHORTSTRING
BY CLIENTID
WHERE SHORTSTRING NE ' '
END

Produces the following:

CLIENTID SHORTSTRING
-------- -----------
12345 '9234'
'9932'
'97'
'936269'
'939292'
82805 '991234'
'953221'
'912'
'915347'
'917'
'969'
'939292'
82836 '921438'
'913432'
'917'

I think this is what you're looking for.
 
Posts: 13 | Location: Montreal,Canada | Registered: August 22, 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     reading special fields

Copyright © 1996-2020 Information Builders