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] Is there a setting for PCHOLD XML output format?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Is there a setting for PCHOLD XML output format?
 Login/Join
 
Virtuoso
posted
Hey all,

I'm including some simple TABLE FILE queries that do not have an output format specified yet. Is there some way to specify that using a setting instead of using ON TABLE PCHOLD?

The reason for this is that I want to keep those table file definitions as generic as possible; I don't want to include the output format in them, but instead want to control that from outside the TABLE FILE definition. Can that be done? And if so, how?

I'm effectively trying to accomplish something similar to what /ibi_apps/RemoteValues does (see also the discussion on "Wanting to beat HTML Composer into submission!"), but done properly.

What I'm looking for would look like the following:
<script type="text/javascript">
var tableFile = $("#query").text();
var data = "SET HOLD = PCHOLD\r\nSET FORMAT = XML\r\n" + tableFile;
</script>
<div id="query" style="display:none;">
TABLE FILE CAR
SUM FST.CAR
BY CAR
BY MODEL
WHERE COUNTRY = &country;
END
</div>


P.S. A JSON output format would even be better, but that doesn't appear to be supported (in our version).

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


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Master
posted Hide Post
ON TABLE PCHOLD FORMAT XML

Be warned, this gives you ugly XML. If you need to customize it per a homegrown DTD, you need to roll your own.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Guru
posted Hide Post
How about SET ONLINE-FMT? It's in the help file but it does not specify XML.

  
SET ONLINE-FMT = XML

TABLE FILE CAR
SUM
   FST.CAR
BY CAR
BY MODEL
END


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Guru
posted Hide Post
Regarding your comment about wanting JSON. Here is sample of something similar to what was used on a project of mine.

  
SET MESSAGE = OFF
SET HOLDLIST = PRINTONLY

-* FILEDEF to store the text file
FILEDEF H2 DISK h2.txt (APPEND
-RUN

TABLE FILE CAR
SUM
    COMPUTE CNT/I11 = CNT + 1;
    COMPUTE OPTION/A65 = '{"carText":"' || CAR || '", "carValue":"' || CAR || '"}';
BY CAR NOPRINT
ON TABLE HOLD AS H1
END
-RUN
-SET &LAST_RECORD = &RECORDS;

-* Write Opening Bracket
-WRITE H2 [

-* Write JSON items
TABLE FILE H1
PRINT
    COMPUTE OPTION/A70 = IF CNT EQ &LAST_RECORD THEN OPTION ELSE OPTION || ',';
ON TABLE HOLD AS H2 FORMAT ALPHA
END
-RUN

-* Write Closing Bracket
-WRITE H2 ]

-* Output the text file using EDAGET
EX EDAGET TXT,h2.txt,T


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Mighty Max:
How about SET ONLINE-FMT? It's in the help file but it does not specify XML.


Ah, brilliant, that works! Silly documentation...

Regarding the JSON format; I can't readily hard-code all that stuff as I don't know what the query will be like before-hand. It just gets sent verbatim to the reporting server, which is also why I can't use ON TABLE PCHOLD.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
I ran into a snag: FOC034...

If I execute this code in the command console (I call the adhocfex in my code):
SET ONLINE-FMT=XML

-SET &ECHO = ALL;
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
TABLE FILE CAR
SUM COMPUTE CS/A43 = CAR | ' ('|| MODEL || ')';
BY COUNTRY
BY CAR
BY MODEL
END


The result is:
 0 ERROR AT OR NEAR LINE     11  IN PROCEDURE ADHOCRQ FOCEXEC *
 (FOC034) THE PRINT LINE EXCEEDS THE MAXIMUM LINE WIDTH. WIDTH IS: 98


If I use ON TABLE PCHOLD FORMAT XML instead of SET OUTPUT-FMT=XML the code works, but I can't do that in my application...

Is there a way around this issue?


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
SET PANEL=200


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
Thanks, that helped.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report 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] Is there a setting for PCHOLD XML output format?

Copyright © 1996-2020 Information Builders