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.
1. Did 8 TABLE FILE requests to get the 2 records for each column into 8 individual files:
TABLE FILE THATFILE PRINT Column_X BY Sort_Fld ON TABLE HOLD AS COLUMN_X END
2. Then I used MATCH FILE with MORE to concatenate those 16 records into 1 file. 3. After the MATCH FILE, used a DEFINEd counter to identify each row of the MATCH output. 4. Concatenated the counter to the Sort_Fld to give each row a unique value (eg. FOR_FLD). 5. Additionally, the 000000000 records needed to be displayed in one column and the 999999999 records displayed in another column, so I created 2 "bucket" fields to take care of this. 6. FOR_FLD was used as the FOR field to paint the report in the FML painter.
To satisfy the rules of the MORE (universal concatenation) command, all verb objects were converted to a single format (D12) from their original I9 and D7.2% formats.
How can I get these formats changed back in the final report? Or is there another way to get the report to display as shown in the FINAL OUTPUT? The FML painter was my idea since it allowed for free form "painting" of the report - FML is not a requirement.
MarciaThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.73 Windows, Unix, AS/400 (iSeries) HTML, PDF, MS Excel (including templates), HTML Active Reports
1. I would use the Macguver technique to make the columns rows. I just posted a similar solution.
2. Are you aware that you can have a dynamic format.
If you make sure that your data files that is converted to rows from columns has an extra column that contains the format of the field, then you can use it. e.g. DATAFIELD/FORMATFIELD.
As long as your numeric column contains enough decimal and unit places to cater for all formats, this should work.
MacGyver technique has never made sense to me. Which thread contains your mentioned 'similar solution' and I can take a look at it to see if I can use it for this.
WebFOCUS 7.73 Windows, Unix, AS/400 (iSeries) HTML, PDF, MS Excel (including templates), HTML Active Reports
And Macgyver concept is quite simple if you strip away the myth.
In this incarnation, all we are doing is creating a table of numbers that can be joined to. By joining avery record from one file to every record from the other, we can then assing a column to a row number.
ERROR_MR_FEX_NOT_FOUND means you are running the fex from MRE. As MRE scans the code for -INCLUDE and EX commands, and the EDAPUT command is internal, it will fail.
What you need to do is wrap the 7 lines of the commmand in -MRNOEDIT BEGIN and END.
-MRNOEDIT BEGIN
EX -LINES 7 EDAPUT MASTER,fseq,CV,FILE
FILE=FSEQ, SUFFIX=FIX
SEGNAME=SEG1
FIELD=CONTROL, BLANK, A1, A1, $
SEGNAME=SEG2, PARENT=SEG1, OCCURS=VARIABLE
FIELD=WHATEVER, , A1, A1, $
FIELD=COUNTER, ORDER, I4, I4,$
-MRNOEDIT END
-* Create starting data. SET PAGE=NOLEAD TABLE FILE CAR SUM DEALER_COST RETAIL_COST SALES LENGTH WIDTH HEIGHT WEIGHT WHEELBASE FUEL_CAP ON TABLE HOLD AS 'car1' END TABLE FILE CAR1 PRINT * END -* -* Anti-Cross tab of &TABLE. -SET &TABLE = 'CAR1'; APP FI assign DISK assign.fex TABLE FILE syscolum PRINT COMPUTE Line/I3 = IF LAST Line EQ 0 THEN 1 ELSE Line+1; NOPRINT COMPUTE Assign/A99 = 'IF Line EQ ' | EDIT(Line) | ' THEN ' | NAME || ' ELSE'; WHERE TBNAME EQ '&TABLE' ON TABLE SET HOLDLIST PRINTONLY ON TABLE HOLD AS Assign FORMAT ALPHA END -RUN -* TABLE FILE syscolum PRINT NAME WHERE TBNAME EQ '&TABLE' ON TABLE HOLD AS syscol END -* SQL SELECT * FROM syscol,&TABLE; TABLE ON TABLE HOLD AS combined END -* TABLE FILE combined PRINT NAME COMPUTE Line/I3 = IF LAST Line EQ 0 THEN 1 ELSE Line+1; NOPRINT COMPUTE Measure/P20.2 = -INCLUDE assign 0; END
WebFOCUS 8.2.06
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010
Yes, the first procedure creates the assign.fex, it generates:
IF Line EQ 001 THEN DEALER_COST ELSE IF Line EQ 002 THEN RETAIL_COST ELSE IF Line EQ 003 THEN SALES ELSE IF Line EQ 004 THEN LENGTH ELSE IF Line EQ 005 THEN WIDTH ELSE IF Line EQ 006 THEN HEIGHT ELSE IF Line EQ 007 THEN WEIGHT ELSE IF Line EQ 008 THEN WHEELBASE ELSE IF Line EQ 009 THEN FUEL_CAP ELSE
If you comment the code line TABLE ON TABLE HOLD AS COMBINED from the SQL query, you will see what it creates and understand how the assign.fex logic picks off a different column value for each row to assign to the Measure column. The SQL query is matching the SYSCOLUM data, one row for each original column, to the original data row using a Cartesian product. So this same approach can work even if your original source data has more than one row, but that would require a few more tweaks. I hope this helps.
WebFOCUS 8.2.06
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010
That is what I was thinking. I did run the first block of code and it gave me the results posted and I got so excited that it was leading me in the right direction, but I just wanted to ensure that I was clear on what was being done.
I need to hand the final result over to my power user for maintenance going forward and I think I can talk him through this much easier than MacGyver. ;-)
WebFOCUS 7.73 Windows, Unix, AS/400 (iSeries) HTML, PDF, MS Excel (including templates), HTML Active Reports
Everything works will until the SQL SELECT statement. Here is the output so far:
TABLE FILE syscolum PRINT NAME WHERE TBNAME EQ 'CAR1' ON TABLE HOLD AS syscol END -RUN 0 NUMBER OF RECORDS IN TABLE= 9 LINES= 9 -* SQL SELECT * FROM syscol, CAR1; TABLE ON TABLE HOLD AS combined END -RUN 1 0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0 ....
What am I doing wrong?
Marcia
WebFOCUS 7.73 Windows, Unix, AS/400 (iSeries) HTML, PDF, MS Excel (including templates), HTML Active Reports
Interestingly, there is data in car1 when the assign -INCLUDE is executed on its own, but for some reason it has 0 records when utilized in the parent/calling procedure. I am still looking into this and if you can think of anything that would cause that let me know.
Thanks, David
WebFOCUS 7.73 Windows, Unix, AS/400 (iSeries) HTML, PDF, MS Excel (including templates), HTML Active Reports