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     CLOSED]appending 2 hld files

Read-Only Read-Only Topic
Go
Search
Notify
Tools
CLOSED]appending 2 hld files
 Login/Join
 
Platinum Member
posted
I have a report where it takes several steps to get to a hold file. Then I have to create another several steps and then get to a second hold file. I need to append my hold1 and hold2 files together. Is the best way to do this is to use the more or to use the filedef? And where do I put this in the code?

malinda

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


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 2010Report This Post
Expert
posted Hide Post
I tend to use MORE.

SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
-RUN

TABLE FILE CAR
SUM
SALES/D8
COMPUTE GROUP1/A16 = COUNTRY;
BY COUNTRY NOPRINT
WHERE SALES GT 10000
ON TABLE HOLD AS H001
END
-RUN

DEFINE FILE GGORDER
SALES/D8 = QUANTITY * UNIT_PRICE;
END
-RUN

TABLE FILE GGORDER
SUM SALES
COMPUTE GROUP1/A16 = PRODUCT_DESCRIPTION;
BY PRODUCT_DESCRIPTION NOPRINT
WHERE QUANTITY LT 40
ON TABLE HOLD AS H002
END
-RUN

TABLE FILE H001
PRINT *
ON TABLE HOLD AS H100
MORE
FILE H002
END
-RUN

TABLE FILE H100
PRINT 
SALES
BY GROUP1
END
-RUN

MORE
FILE ...
must be the last two statements before the END statement.


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
The other option is to use FILEDEF ... (APPEND

TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS APPND FORMAT ALPHA
END
FILEDEF APPND DISK appnd.ftm (APPEND
TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'FRANCE'
ON TABLE HOLD AS APPND FORMAT ALPHA
END
FILEDEF APPND DISK appnd.ftm
TABLE FILE APPND
PRINT *
END


It does rely on the second TABLE FILE's field matching the firsts.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
OR two hold format focus and a USE command. Lots of different ways for this one.


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
Expert
posted Hide Post
Are you setting a Challenge ?

Big Grin


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Or, if using HOLDFORMAT ALPHA, you can use an OS command to append or concatenate the two files.
TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD FORMAT ALPHA
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'FRANCE'
ON TABLE SAVE
END
-RUN
-UNIX cat save.ftm >> hold.ftm


Or if using HOLDFORMAT BINARY:

TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE SET HOLDFORMAT BINARY
ON TABLE HOLD
END
FILEDEF HOLD DISK hold.ftm ( LRECL 56 RECFM F APPEND
TABLE FILE CAR
PRINT COUNTRY CAR MODEL SALES
WHERE COUNTRY EQ 'FRANCE'
ON TABLE SAVB AS HOLD
END
-RUN


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
There you go Malinda! Many options to choose from.

Personally, I prefer FILEDEF (APPEND as it allows me to create and append to my target file upon retrieving data from the database; other valid approaches usually require reading from your database and putting your data in a HOLD file (repeating those 2 steps as many times as data sources you need to concatenate) and later reading all your HOLD files in order to concatenate them. This may not be significant if you're dealing with "small" sets of data but if you see yourself creating "big" HOLD files (because your business rules report so require) then creating those HOLD files and querying them again so that they can be concatenated at the end may impact performance. In addition, when using FILEDEF (APPEND you are not limited to ALPHA format; BINARY works just as fine.

Every feature and functionality has its place (IBI would have never implemented them otherwise Smiler ). Just pick the one that better suits your needs.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
I prefer the USE method.


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Expert
posted Hide Post
If your data is already in FOCUS files, the USE is great, if nit, then it will depend on how much data you have to append.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
I was able to get the MORE to work. Thanks for all the help!

malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
 
Posts: 149 | Registered: April 15, 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     CLOSED]appending 2 hld files

Copyright © 1996-2020 Information Builders