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.
Trying to write a query that pulls a student's previous transfer colleges. I need the college name, beginning date, and ending date. The user wants a field for College 1, College 2, etc. The dates have to be in their own fields, too.
The database:
STUDENT ID SEQUENCE COLLEGE BEGIN DATE END DATE
1234 1 1st College 201301 0
2 2nd College 200208 200305
What user wants:
STUDENT ID COLLEGE 1 BEGIN END COLLEGE 2 BEGIN END
1234 1st College 201301 0 2nd College 200208 200305
I solved the problem of assigning the college names to their own fields with this:
DEFINE FILE COLHIST1
COL1/A32 = IF (SEQUENCE EQ 1) THEN COLLEGE_NAME;
COL2/A32 = IF (SEQUENCE EQ 2) THEN COLLEGE_NAME;
COL3/A32 = IF (SEQUENCE EQ 3) THEN COLLEGE_NAME;
END
But when I tried the same thing with the dates, all of them are completely off.
DEFINE FILE COLHIST1
BEG_DT1/I9 = IF (SEQUENCE EQ 1) THEN BEGIN_DT;
BEG_DT2/I9 = IF (SEQUENCE EQ 2) THEN BEGIN_DT;
BEG_DT3/I9 = IF (SEQUENCE EQ 3) THEN BEGIN_DT;
END_DT1/I9 = IF (SEQUENCE EQ 1) THEN END_DT;
END_DT2/I9 = IF (SEQUENCE EQ 2) THEN END_DT;
END_DT3/I9 = IF (SEQUENCE EQ 3) THEN END_DT;
END
I am wondering whether it has something to do with the date being a 9-character integer, because obviously what the database is showing is not 9 characters. And on the user's display screen, it shows up MM-YYYY. I have double-checked and I am grabbing the right field.
Any suggestions would be appreciated.This message has been edited. Last edited by: <Kathryn Henning>,
Dev. Studio 7.6.11 Win 7
Posts: 21 | Location: Oklahoma | Registered: November 01, 2012
Thank you JL and Francis. Francis, I am not sure an ACROSS would work since this is just a very small part of a much larger program. The final report will have over 150 columns. (Yeah, they asked the new guy with no experience to do it. )
JL, that is a seriously awesome bit of code! That will help so much in the future. Thank you for that new tool!
Anyway, this is what the report says that the beginning and ending dates actually are
BEGIN_DT E05 I11
END_DT E06 I11
Another programmer just stepped into my office and said something about the dates have to be DECODED and something about "packed" and pointed to our FOCUS manual. So, I guess I have some reading to do.
Dev. Studio 7.6.11 Win 7
Posts: 21 | Location: Oklahoma | Registered: November 01, 2012
Since the fields are defined as I11, they're not "packed" and they don't need to be DECODED. Just use the same format in your DEFINE.
I'm not sure why ACROSS would not work here. If you create a HOLD file using ACROSS, you will end up with field names similar to the ones in your DEFINE, the SEQUENCE field makes the names different:
SET ASNAMES=ON
SET HOLDLIST=PRINTONLY
TABLE FILE COLHIST1
SUM
COLLEGE
BEGIN DATE
END DATE
BY STUDENT_ID
ACROSS SEQUENCE
ON TABLE HOLD AS H001
END
-RUN
?FF H001
-RUN
The generated names will be abbreviated and perhaps not to your liking, but that shouldn't matter - it avoids having to define virtual fields for every SEQUENCE.
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
Sam, I assume that for each student you have a sequence from 1 to whatever. Since you say that there is more than meets the eye (btw, who would want a report with 150 columns??? crazy!!!), I would suggest using some dialog manager to create fields for each college.
TABLE FILE COLHIST1
SUM MAX.SEQUENCE
ON TABLE SAVE
END
-RUN
-READ SAVE,&MAXSEQ
-RUN
DEFINE FILE COLHIST1
-REPEAT #FIELDS FOR &I FROM 1 TO &MAXSEQ;
COLLEGE&I / A32 = IF SEQUENCE EQ &I THEN COLLEGE_NAME ELSE ' ';
BDATE&I / I6 = IF SEQUENCE EQ &I THEN BEGIN_DATE ELSE 0;
EDATE&I / I6 = IF SEQUENCE EQ &I THEN END_DATE ELSE 0;
-#FIELDS
END
TABLE FILE COLHIST1
SUM
-REPEAT #PRINT FOR &I FROM 1 TO &MAXSEQ;
MAX.COLLEGE&I MAX.BDATE&I MAX.EDATE&I
-#PRINT
BY STUDENT_ID
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Thank you everyone for the suggestions. I just learned, however, that the data entry clerks use neither rhyme nor reason when entering the sequences. So, that puts the breaks on my efforts.
I do think these suggestions are fantastic. I want to try every one when I get back to that point. Again, thank you.
Dev. Studio 7.6.11 Win 7
Posts: 21 | Location: Oklahoma | Registered: November 01, 2012
Using an ACROSS gave me an error of "Max of 255 across instances in online report exceeded." But I think I have it figured out now. The real problem turned out to be that the SEQUENCE numbers were entered by the data entry clerks without rhyme or reason. So, I had to define my own. Once I did, a simple JOIN caused everything fall into place.
I appreciate everybody's help.
Dev. Studio 7.6.11 Win 7
Posts: 21 | Location: Oklahoma | Registered: November 01, 2012
Oops ... You're right Frank. Should be SUM. And I echo someone else's remark - Who wants a report with more than 200 columns ??? I know that wide screens are available now, but still ...
George, One hears so many. When a customer asks me in WebFOCUS can retrieve 10,000 records, I ask, with incredulity, who might want to leaf through 10,000 lines of a report? The whole idea of BI is to allow the user to zoom in to what is desired. Oh well...
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
I do agree to Danny on this matter. BI is business intelligente. Convert data to Information. Many users ask for data in a spreadsheet but in the end they are going to make a pivot report on the data we deliver. When they take the time to look at the deeper possibilities we can offer, some make the next step.
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, 2006