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     [Resolved]Merge 2 Hold files

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Resolved]Merge 2 Hold files
 Login/Join
 
Platinum Member
posted
I am sure this can be done but cannot find the solution. I have 2 hold files. One is a list of user_ids and one is a list of all calendar dates for specific month. I need to merge the 2 files into a single file for subsequent reporting. For example:

user_id
1234
5846
8412

Calendar days in text format
2014_10_01
2014_10_02
2014_10_03
2014_10_04
2014_10_05

Ultimately I need to concatenate the fields into the following:
2014_10_02_1234
2014_10_03_1234
2014_10_04_1234
2014_10_05_1234
2014_10_01_5846
2014_10_02_5846
2014_10_03_5846
2014_10_04_5846
2014_10_05_5846
2014_10_01_8412
2014_10_02_8412
2014_10_03_8412
2014_10_04_8412
2014_10_05_8412

Any ideas on how to do this? I tried match but that did not produce what I needed.

Thank you,
Geri Gellman

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




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
Member
posted Hide Post
You can MacGyver it.

  
SET HOLDLIST = PRINTONLY

DEFINE FILE CAR
BLANK/A1 = ' ';
END

TABLE FILE CAR
SUM
BLANK NOPRINT
BY BLANK
PRINT
CAR
BY BLANK
ON TABLE HOLD AS HOLD1 FORMAT FOCUS INDEX BLANK
END

JOIN BLANC WITH RELDATE IN MOVIES TO UNIQUE BLANK IN HOLD1 AS J1

DEFINE FILE MOVIES
BLANC/A1 = ' ';
END

TABLE FILE MOVIES
PRINT
CAR
RELDATE/YYMD
COMPUTE DATE_TXT/A9 = EDIT(RELDATE, '99_99_99_' );
COMPUTE NEWFIELD/A50 = DATE_TXT | CAR;
BY CAR
ON TABLE PCHOLD FORMAT AHTML
END



 
Posts: 23 | Location: Cincinnati, OH | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
quote:
SET HOLDLIST = PRINTONLY

DEFINE FILE CAR
BLANK/A1 = ' ';
END

TABLE FILE CAR
SUM
BLANK NOPRINT
BY BLANK
PRINT
CAR
BY BLANK
ON TABLE HOLD AS HOLD1 FORMAT FOCUS INDEX BLANK
END

JOIN BLANC WITH RELDATE IN MOVIES TO UNIQUE BLANK IN HOLD1 AS J1

DEFINE FILE MOVIES
BLANC/A1 = ' ';
END

TABLE FILE MOVIES
PRINT
CAR
RELDATE/YYMD
COMPUTE DATE_TXT/A9 = EDIT(RELDATE, '99_99_99_' );
COMPUTE NEWFIELD/A50 = DATE_TXT | CAR;
BY CAR
ON TABLE PCHOLD FORMAT AHTML
END



Above is exactly what I needed! Thanks!




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
Expert
posted Hide Post
You could also use a condition based join.

Please see this

Just don't specify a where clause.


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
...it took me some time to find a simple solution for this.

But I think I did.

SET ASNAMES = ON
TABLE FILE CAR
	BY	CAR
ON TABLE HOLD AS HLD_CAR
END

TABLE FILE CAR
	BY	COUNTRY
ON TABLE HOLD AS HLD_COUNTRY
END

-* SQL join
SQL
SELECT
	HLD_CAR.CAR, HLD_COUNTRY.COUNTRY
FROM HLD_CAR
INNER JOIN HLD_COUNTRY;
TABLE HOLD AS HLD_CARTESIAN
END
-RUN

TABLE FILE HLD_CARTESIAN
	PRINT *
END


Yes, this works.
You can even add join-conditions ( in sql ).
Or even some other SQL stuff.


SQL
insert into HLD_CARTESIAN ( CAR , COUNTRY ) VALUES ( 'DODGE' , 'USA' );
END


tags for future reference:
cartesian
cartesian product
sql join
conditional join
sql insert

[ should we start using #hashtags?? ]


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 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     [Resolved]Merge 2 Hold files

Copyright © 1996-2020 Information Builders