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.
Each STATION has one or more higher-level STATIONs. I'd like to determine the "parent" STATION by finding the first non-blank value from STATION_LVL2, STATION_LVL3, STATION_LVL4 and STATION_LVL5.
I can COMPUTE a column using IF ELSE IF syntax, but I was wondering if there was a quicker method, with a function perhaps, something like MAX(STATION_LVL2, STATION_LVL3, STATION_LVL4, STATION_LVL5), though, in this case, MAX will not give me what I need.
Any ideas?
Thanks,This message has been edited. Last edited by: Kerry,
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
It is a lost art! I think I have my alternate Master with the OCCURS working (it's more complicated than the example I posted - I have four columns that require individual OCCURS).
What do I do next? I can print the values, but how do I determine which of the fields in the OCCURS is the first non-blank one?
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
FILEDEF HSTATION_ALT DISK baseapp/hstation.txt
-RUN
TABLE FILE HSTATION_ALT
PRINT
LVL14_STATION_ID AS 'STATION_ID '
LVL14_STATION AS 'STATION '
LVL14_STATION_NM AS 'STATION_NM '
LVL14_STATION_LVL AS 'STATION_LVL'
WSTATION_ID AS 'PARENT_STATION_ID '
WSTATION AS 'PARENT_STATION '
WSTATION_NM AS 'PARENT_STATION_NM '
WSTATION_LVL AS 'PARENT_STATION_LVL'
-*BY LOWEST 1 WSTATION_LVL NOPRINT
-*WHERE WSTATION NE ''
END
-RUN
Removing the comment on the where statement will show you only those occurs that have data. I thought sorting BY LOWEST 1 would work, but it doesn't.
Sorry about the wide data!
Data:
42C0000DEFAULT H.U.B. 14. . . 18. . . 20. . . 22. . . 24. . . 28 8776U6477PCFS GROUP ADJUSTMENTS 35. . . 42
43C0001MONTANAS, SUCC. PRINC. DE 14 20492U1178CON MONTANAS (SUCC.PROPOSED 1)18. . . 20. . . 22. . . 24. . . 28 8912U7131COLL. CENTER-SITES EST 35 8809U7013REGION CENTER-SITES DE ASF 42
44C0002FIRST AMERICAN STATE ORLEANS 14 24778U6044FIRST AMERICAN STATE EASY 18. . . 20. . . 22. . . 24. . . 28 8986U7205ORLEANS DOWNTOWN AREA 35 8821U7025GTA CENTRAL DISTRICT 42
45C0003BARBADOS MAIN APPLES MAN 14 19549U3539BARBADOS M.O. EASY 18. . . 20. . . 22. . . 24. . . 28 9213U7441BARBADOS CENTRAL AREA 35 8839U7043MONTANAS & NW CHICAGO DISTRICT42
46C0004MAIN APPLES FRANCISCO BC 14 21426U0695MO FRANCISCO CONSOL 18. . . 20. . . 22. . . 24. . . 28 9378U7611FRANCISCO DOWNTOWN AREA 35 56181U4992FRANCISCO CENTER DISTRICT 42
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
Here is what I have so far, pending your answer to my previous question.
APP FI HSTNMAS DISK hstation_alt.mas
-RUN
-WRITE HSTNMAS FILENAME=HSTATION_ALT, SUFFIX=FIX, $
-WRITE HSTNMAS SEGMENT=HSTATION, SEGTYPE=S0, $
-WRITE HSTNMAS FIELDNAME=LVL14_STATION_ID , ALIAS=LVL14_STATION_ID , USAGE=I11, ACTUAL=A11, $
-WRITE HSTNMAS FIELDNAME=LVL14_STATION , ALIAS=LVL14_STATION , USAGE=A05, ACTUAL=A05, $
-WRITE HSTNMAS FIELDNAME=LVL14_STATION_NM , ALIAS=LVL14_STATION_NM , USAGE=A30, ACTUAL=A30, $
-WRITE HSTNMAS FIELDNAME=LVL14_STATION_LVL, ALIAS=LVL14_STATION_LVL, USAGE=A02, ACTUAL=A02, $
-WRITE HSTNMAS SEGNAME=WNODE, PARENT=HSTATION, OCCURS=7, $
-WRITE HSTNMAS FIELDNAME=WSTATION_ID , ALIAS=WSTATION_ID , USAGE=I11, ACTUAL=A11, $
-WRITE HSTNMAS FIELDNAME=WSTATION , ALIAS=WSTATION , USAGE=A05, ACTUAL=A05, $
-WRITE HSTNMAS FIELDNAME=WSTATION_NM , ALIAS=WSTATION_NM , USAGE=A30, ACTUAL=A30, $
-WRITE HSTNMAS FIELDNAME=WSTATION_LVL, ALIAS=WSTATION_LVL, USAGE=A02, ACTUAL=A02, $
-WRITE HSTNMAS FIELDNAME=CNTR, ALIAS=ORDER, USAGE=I4, ACTUAL=I4, $
APP FI HSTATION_ALT DISK hstation_alt.ftm
-RUN
-WRITE HSTATION_ALT 42C0000DEFAULT H.U.B. 14. . . 18. . . 20. . . 22. . . 24. . . 28 8776U6477PCFS GROUP ADJUSTMENTS 35. . . 42
-WRITE HSTATION_ALT 43C0001MONTANAS, SUCC. PRINC. DE 14 20492U1178CON MONTANAS (SUCC.PROPOSED 1)18. . . 20. . . 22. . . 24. . . 28 8912U7131COLL. CENTER-SITES EST 35 8809U7013REGION CENTER-SITES DE ASF 42
-WRITE HSTATION_ALT 44C0002FIRST AMERICAN STATE ORLEANS 14 24778U6044FIRST AMERICAN STATE EASY 18. . . 20. . . 22. . . 24. . . 28 8986U7205ORLEANS DOWNTOWN AREA 35 8821U7025GTA CENTRAL DISTRICT 42
-WRITE HSTATION_ALT 45C0003BARBADOS MAIN APPLES MAN 14 19549U3539BARBADOS M.O. EASY 18. . . 20. . . 22. . . 24. . . 28 9213U7441BARBADOS CENTRAL AREA 35 8839U7043MONTANAS & NW CHICAGO DISTRICT42
-WRITE HSTATION_ALT 46C0004MAIN APPLES FRANCISCO BC 14 21426U0695MO FRANCISCO CONSOL 18. . . 20. . . 22. . . 24. . . 28 9378U7611FRANCISCO DOWNTOWN AREA 35 56181U4992FRANCISCO CENTER DISTRICT 42
TABLE FILE HSTATION_ALT
PRINT SEG.WSTATION_ID
BY LVL14_STATION_ID
BY LVL14_STATION
BY LVL14_STATION_NM
BY LVL14_STATION_LVL
BY CNTR
WHERE WSTATION_ID NE 0
END
I took your POSITION field out as you don't need it if the OCCURS are at the end of a record. I added an ORDER field in case it might be useful later on.
SUM
FST.WSTATION_ID AS 'PARENT_STATION_ID '
FST.WSTATION AS 'PARENT_STATION '
FST.WSTATION_NM AS 'PARENT_STATION_NM '
FST.WSTATION_LVL AS 'PARENT_STATION_LVL'
BY LVL14_STATION_ID AS 'STATION_ID '
BY LVL14_STATION AS 'STATION '
BY LVL14_STATION_NM AS 'STATION_NM '
BY LVL14_STATION_LVL AS 'STATION_LVL'
WHERE WSTATION NE ' '
they're all integer, right? so its zero you're looking for, yes? DEFINE FILE X S0/I1=STATION/STATION; S1/I1=STATION_LVL1/STATION_LVL1; S2/I1=STATION_LVL2/STATION_LVL2; S3/I1=STATION_LVL3/STATION_LVL3; S4/I1=STATION_LVL4/STATION_LVL4; S5/I1=STATION_LVL5/STATION_LVL5; ISSUM/I6=S5 + S4*10 + S3*100 + S2*1000 + S1*10000 + S0*100000; ASUM/A6=EDIT(ISSUM); WHERE/I1=POSIT(ASUM,6,'0',1,WHERE); END
reduces your row to zeros and ones. i so miss my economics days we'ld take a time series vector and create a matching vector of proxies wherever missing or 0 data existed. sigh... the days of actually having to think...
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003