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.
If the line length is not too long, how about creating a master file to read it, and manipulate it in a TABLE FILE or alternatively, -READ it in a loop and -WRITE it out
You could install a javascript interpreter on your server, for example nodejs, and execute a script through that to convert the JSON message.
Added bonus, I suspect you can do something similar for JSCHART graphs to create output suitable for inclusion in PDF, Excel, etc.
It's something I've been meaning to experiment with, but haven't gotten around to.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
I have used javascript to remove "records" and i have converted JSON to JS object. That worked.
I am not sure how it's going to affect performance! . Have to check with larger data set.
Seems i need to wait for 8.2.2 for getting in built responsive tabular report with WebViewer ON. Current implementation of Webviewer is adding Iframe and its breaking all responsiveness.
I can't see how PUTDDREC is different than regular DEFINE or COMPUTE.
Admittedly, the above is only a simple example, but you can perform multiple PUTDDREC operations within the same table request.
For instance, if your requirement was a more hierarchical format -
FILEDEF PUTDD1 DISK focalpoint/putdd1.json
-RUN
TABLE FILE CAR
SUM COMPUTE CNTR1/I3 = LAST CNTR1 + 1;
COMPUTE CNTR2/I3 = IF COUNTRY NE LAST COUNTRY THEN 1 ELSE LAST CNTR2 + 1;
COMPUTE CNTR3/I3 = IF CAR NE LAST CAR THEN 1 ELSE LAST CNTR3 + 1;
COMPUTE CNTR4/I3 = IF MODEL NE LAST MODEL THEN 1 ELSE LAST CNTR4 + 1;
COMPUTE ROW6/I3 = IF CAR NE LAST CAR AND CNTR1 NE 1 THEN PUTDDREC('PUTDD1', 20, ' ] } },', 50, 'I3');
COMPUTE ROW5/I3 = IF COUNTRY NE LAST COUNTRY AND CNTR1 NE 1 THEN PUTDDREC('PUTDD1', 20, ' ] } },', 50, 'I3');
COMPUTE ROW1/I3 = IF CNTR1 EQ 1 THEN PUTDDREC('PUTDD1', 20, '{"data": { [', 50, 'I3');
COMPUTE ROW2/I3 = IF CNTR2 EQ 1 THEN PUTDDREC('PUTDD1', 20, ' {"country": {"' || COUNTRY || '" [', 50, 'I3');
COMPUTE ROW3/I3 = IF CNTR3 EQ 1 THEN PUTDDREC('PUTDD1', 20, ' {"car": {"' || CAR || '" [', 50, 'I3');
COMPUTE ROW4/I3 = IF CNTR4 EQ 1 THEN PUTDDREC('PUTDD1', 20, ' {"model": "' || MODEL || '", "sales": ' || LJUST(12, FPRINT(SALES, 'D10.2', 'A12'), 'A12') || '}', 100, 'I3');
BY COUNTRY
BY CAR
BY MODEL
ON TABLE SAVE
END
-RUN
-SET &Line7 = ' ] } },';
-SET &Line8 = ' ] } },';
-SET &Line9 = '] } }';
FILEDEF PUTDD1 DISK focalpoint/putdd1.json (APPEND
-RUN
-WRITE PUTDD1 &Line7
-WRITE PUTDD1 &Line8
-WRITE PUTDD1 &Line9