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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Append Two Files
 Login/Join
 
Member
posted
I have two files that I would like to combine. File A has ten columns and 50 rows while File B only has one column and one row. I would like to append the one column in File B to each row in File A. Is there a way to do this? I can't merge or match because neither file has any fields in common.


WebFOCUS 7.1.4, Windows XP
 
Posts: 3 | Registered: March 08, 2007Report This Post
Expert
posted Hide Post
Create a phony key for file A and have the value be the same value for each record (like 1) then hold it.

Do the same for file B only hold that one as a focus file index phonykey.

The join holda to holdb and print.


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
Expert
posted Hide Post
First, Lindbo, edit your signature block on your profile to tell us your current system and versions, and where you are located, and a bit about who you are and your experience level.
Second, i would have said read up on MacGyver and cartesian products, but
it seems your case is quite simple..
if FILEB has only 1 col and 1 row, then it would seem to contain just one single element of information.
So why not
1.read FILEB into a flat file
2.read that flat file with a -READ , thus forming an &var for that one single element.
3. issue a define on FILEA defining a new field whose value is that constant
4. table FILEA along with the newly defined field.
Ok so far?
Here's an example:
-* here's file B
TABLE FILE CAR
PRINT COUNTRY IF CAR IS 'JAGUAR'
ON TABLE SAVE AS VERYSILLY
END
-RUN
-READ VERYSILLY &MYCOUNTRY.A10
-TYPE &MYCOUNTRY
.* should show you that &MYCOUNTRY = 'ENGLAND';
.* now for the fileA bit
DEFINE FILE CAR
NEWCOUNTRY/A10 WITH COUNTRY = '&MYCOUNTRY';
-* nb: no quotes if your value is a number
-* nb: remember the WITH fieldname when you define a var that is a constant; 
-*the define has no idea what segment to stick the new field to; 
-*if you're not reading a multisegment focus file, then it doesn't  matter
END
TABLE FILE CAR
PRINT * NEWCOUNTRY
ON TABLE whatever
END


Just FYI, for us Pointy heads, the word APPEND suggests vertical concatenation. What you're talking about would be more of a horizontal thing, like a JOIN would be.

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Thank you for all the help. The flat file suggestion worked beautifully!


WebFOCUS 7.1.4, Windows XP
 
Posts: 3 | Registered: March 08, 2007Report This Post
Virtuoso
posted Hide Post
The flat file suugestion is good, but if this is a file with one field and one record you can also say

TABLE FILE CAR
PRINT * 'this is field xxx'
END

But if your one field table is changing every time, the solution Susannah proposed is better....




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
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders