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.
Can someone explaing what is the following code means? SET HOLDLIST = PRINTONLY -*SET PAGESIZE = LETTER SET ASNAMES = ON -DEFAULTH &CAST = 'NO'; -* -SET &UNIT1_FIELD = IF &REPTYPE EQ 'BRAND' AND &BRAND EQ 'FOC_NONE' THEN 'CORP' ELSE - IF &REPTYPE EQ 'BRAND' AND &BRAND NE 'FOC_NONE' THEN 'UPBRAND' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION EQ 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'CORP' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION NE 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'DIVISIONNAME' ELSE - 'DISTRICTNAME'; -SET &UNIT2_FIELD = IF &REPTYPE EQ 'BRAND' AND &BRAND EQ 'FOC_NONE' THEN 'UPBRAND' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION EQ 'FOC_NONE' THEN 'DIVISIONNAME' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DISTRICT EQ 'FOC_NONE' THEN 'DISTRICTNAME' ELSE - 'SCHOOLID'; -SET &UNIT1_WHFIELD = IF &REPTYPE EQ 'BRAND' AND &BRAND EQ 'FOC_NONE' THEN 'FOC_NONE' ELSE - IF &REPTYPE EQ 'BRAND' AND &BRAND NE 'FOC_NONE' THEN 'BRAND' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION EQ 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'FOC_NONE' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION NE 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'DIVISIONID' ELSE - 'DISTRICTID'; -SET &BURST = IF &UNIT1_FIELD EQ 'DIVISIONNAME' THEN 'MAX.DIVISIONID' ELSE - IF &UNIT1_FIELD EQ 'DISTRICTNAME' THEN 'MAX.DISTRICTID' ELSE - IF &UNIT1_FIELD EQ 'SCHOOLID ' THEN 'MAX.SCHOOLID' ELSE ' '; - -SET &UNIT1_VAL = IF &CAST EQ 'YES' THEN 'FOC_NONE' ELSE - IF &BRAND NE 'FOC_NONE' THEN &BRAND ELSE - IF &DISTRICT NE 'FOC_NONE' THEN &DISTRICT ELSE - IF &DIVISION NE 'FOC_NONE' THEN &DIVISION ELSE 'FOC_NONE'; -SET &UNIT1_TITLE = IF &REPTYPE EQ 'BRAND' AND &BRAND EQ 'FOC_NONE' THEN 'Corp.' ELSE - IF &REPTYPE EQ 'BRAND' AND &BRAND NE 'FOC_NONE' THEN 'Brand' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION EQ 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'Corp.' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION NE 'FOC_NONE' AND &DISTRICT EQ 'FOC_NONE' THEN 'Division' ELSE - 'District'; -SET &UNIT2_TITLE = IF &REPTYPE EQ 'BRAND' AND &BRAND EQ 'FOC_NONE' THEN 'Brand' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DIVISION EQ 'FOC_NONE' THEN 'Division' ELSE - IF &REPTYPE EQ 'DIVISION' AND &DISTRICT EQ 'FOC_NONE' THEN 'District' ELSE - 'School'; -* -IF &YEAR NE 'FOC_NONE' THEN GOTO SET_FYPW_0; -SET &DAYINWEEK = DECODE &DATEW ( '6' '-1' '0' '-2' '1' '-3' '2' '-4' '3' '-5' '4' '-6' '5' '-7'); -SET &DATE_0 = AYMD(&YYMD,&DAYINWEEK,'I8'); -SET &DATE_0 = EDIT(&DATE_0,'9999-99-99'); -* TABLE FILE DIM_TIME PRINT 'DIM_TIME.DIM_TIME.FYPW/A7' 'DIM_TIME.DIM_TIME.DATE' WHERE DIM_TIME.DIM_TIME.DATE EQ '&DATE_0'; ON TABLE NOTOTAL ON TABLE SET HOLDLIST PRINTONLY ON TABLE HOLD AS FYPW FORMAT ALPHA END
Yes, I think that there are persons capable of explaining what the code does. It is not that hard. I think you'd be best off following some very basic course on the Dialog Manager language of (Web)focus. Be honest, there are no complicated things in this code, just some basic statements.
Or, maybe the question is not technical at all, but more functional. With that I mean the why of the code, not the how. If that is the case, then you should ask the owner of the software where the functional design documentation is, because we can't help you with the why.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Try different values for the following "input" parameters and analyze what you get with different combination of values:
- &UNIT1 - &UNIT2 - &BURST - &YEAR
Sorry but it is hard to tell you what that code means without a clear understanding of your environment and business rules in place.
I don't see that particular piece of code doing anything "useful" with UNIT1, UNIT2 and BURST.
For now, go to your database and analyze the DIM_TIME (Date/Time Dimension?) table and query it to see what values you get for the DIM_TIME.FYPW field where DIM_TIME.DATE = today's date and maybe some other days so you'll get a feeling as to what FYPW means.
Take it from there ...This message has been edited. Last edited by: njsden,
You can also add the statement -SET &ECHO=ALL; at the top of the code before you run it. This will allow you to see what values are assigned to each variable as the code runs.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Following are Business Rules: My weekly Revenue Report prints current periods' current weeks enrollment number and compare previous periods daily period average enrollemtn numbers. I want to change from period avrage to last three peiords last weeks numbers. How can I accomplish this? The enrollmetn Fex used in this report is as follows: -INCLUDE app/00_setting.fex -* JOIN DIM_TIME_KEY IN AGG_ENROLLMENT TO UNIQUE DIM_TIME_KEY IN DIM_TIME TAG J0 AS J0 END JOIN DIM_PAYORTYPE_KEY IN AGG_ENROLLMENT TO UNIQUE DIM_PAYORTYPE_KEY IN DIM_PAYORTYPE TAG J1 AS J1 END JOIN DIM_PROGRAM_KEY IN AGG_ENROLLMENT TO UNIQUE DIM_PROGRAM_KEY IN DIM_PROGRAM TAG J2 AS J2 END JOIN DIM_SCHOOL_KEY IN AGG_ENROLLMENT TO UNIQUE DIM_SCHOOL_KEY IN DIM_SCHOOL TAG J3 AS J3 END -* -SET &TIME=HHMMSS('A8'); -TYPE ********** Enrollment Start Data Pull - Timestamp: &DATEYYMD &TIME -* DEFINE FILE AGG_ENROLLMENT CORP/A25 = 'Corp.'; UPBRAND/A3 = UPCASE(3,BRAND,'A3'); LITM2/A25 = EDIT(PAYORTYPE,'9999999999999999999999999') ; LITM3/A25 = EDIT(DIM_PROGRAM.GROUPER1,'9999999999999999999999999'); END -* TABLE FILE AGG_ENROLLMENT SUM &UNIT1_FIELD/A25 AS 'UNIT1' &UNIT2_FIELD/A25 AS 'UNIT2' EnrolledActive AS 'ENROLLED' EnrolledUnscheduled AS 'UNSCHED' NewEnroll AS 'NEWENROLL' Withdraw AS 'WITHDRAW' BY FYPW BY LITM2 BY LITM3 BY &UNIT1_FIELD NOPRINT BY &UNIT2_FIELD NOPRINT WHERE &UNIT1_WHFIELD EQ '&UNIT1_VAL' WHERE FYPW LE '&FYPW_0' WHERE FYP EQ '&FYP_0' OR FYP EQ '&FYP_1' OR FYP EQ '&FYP_2' OR FYP EQ '&FYP_3' OR FYP EQ '&FYP_12' OR FYP EQ '&FYP_13' ON TABLE HOLD AS ENRLAGGX FORMAT FOCUS END ?FF ENRLAGGX -RUN -* -SET &TIME=HHMMSS('A8'); -TYPE ********** Enrollment End Data Pull - Timestamp: &DATEYYMD &TIME -*--------------------------------------------------- -* Enrollments (Active) DEFINE FILE ENRLAGGX LITM1/A25 = 'Enrollments'; AMOUNT/P15.2 = ENROLLED; FYP/A6 = EDIT(FYPW,'999999'); END TABLE FILE ENRLAGGX SUM LST.AMOUNT NOPRINT BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYP SUM COMPUTE NEWWK/P15.2 = IF UNIT1 NE LAST UNIT1 OR UNIT2 NE LAST UNIT2 OR LITM1 NE LAST LITM1 OR LITM2 NE LAST LITM2 OR LITM3 NE LAST LITM3 OR FYP NE LAST FYP THEN 1 ELSE 0; NOPRINT AMOUNT COMPUTE AMOUNTW/P15.2 = LST.AMOUNT * NEWWK; BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYP NOPRINT BY FYPW ON TABLE HOLD AS ENRLAGGD FORMAT FOCUS END ?FF ENRLAGGD -RUN !type enrlaggd.mas -* TABLE FILE ENRLAGGD SUM AMOUNT AMOUNTW BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYPW ON TABLE HOLD AS ENRLAGGE FORMAT FOCUS END ?FF ENRLAGGE -RUN !type enrlagge.mas -*--------------------------------------------------- -* Enrollments (Unscheduled) DEFINE FILE ENRLAGGX LITM1/A25 = 'Enrollments Unsched.'; AMOUNT/P15.2 = UNSCHED; FYP/A6 = EDIT(FYPW,'999999'); END TABLE FILE ENRLAGGX SUM LST.AMOUNT NOPRINT BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYP SUM COMPUTE NEWWK/P15.2 = IF UNIT1 NE LAST UNIT1 OR UNIT2 NE LAST UNIT2 OR LITM1 NE LAST LITM1 OR LITM2 NE LAST LITM2 OR LITM3 NE LAST LITM3 OR FYP NE LAST FYP THEN 1 ELSE 0; NOPRINT AMOUNT COMPUTE AMOUNTW/P15.2 = LST.AMOUNT * NEWWK; BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYP NOPRINT BY FYPW ON TABLE HOLD AS ENRLAGGD FORMAT FOCUS END ?FF ENRLAGGD -RUN !type enrlaggd.mas -* TABLE FILE ENRLAGGD SUM AMOUNT AMOUNTW BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYPW ON TABLE HOLD AS ENRLAGGU FORMAT FOCUS END ?FF ENRLAGGU -RUN !type enrlaggu.mas -*--------------------------------------------------- -* New Enrollments DEFINE FILE ENRLAGGX LITM1/A25 = 'New Enrollments'; AMOUNT/P15.2 = NEWENROLL; AMOUNTW/P15.2 = 0; END TABLE FILE ENRLAGGX SUM AMOUNT AMOUNTW BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYPW ON TABLE HOLD AS ENRLAGGN FORMAT FOCUS END ?FF ENRLAGGN -RUN !type enrlaggn.mas -*--------------------------------------------------- DEFINE FILE ENRLAGGX LITM1/A25 = 'Withdraws'; AMOUNT/P15.2 = WITHDRAW; AMOUNTW/P15.2 = 0; END TABLE FILE ENRLAGGX SUM AMOUNT AMOUNTW BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYPW ON TABLE HOLD AS ENRLAGGW FORMAT FOCUS END ?FF ENRLAGGW -RUN !type enrlaggw.mas -*--------------------------------------------------- -* New Enrollments DEFINE FILE ENRLAGGX LITM1/A25 = 'Net Enrollments'; AMOUNT/P15.2 = NEWENROLL - WITHDRAW; AMOUNTW/P15.2 = 0; END TABLE FILE ENRLAGGX SUM AMOUNT AMOUNTW BY UNIT1 BY UNIT2 BY LITM1 BY LITM2 BY LITM3 BY FYPW ON TABLE HOLD AS ENRLAGGT FORMAT FOCUS END ?FF ENRLAGGT -RUN !type enrlaggt.mas -*--------------------------------------------------- USE ENRLAGGE AS ENRLAGGN ENRLAGGU AS ENRLAGGN ENRLAGGN AS ENRLAGGN ENRLAGGW AS ENRLAGGN ENRLAGGT AS ENRLAGGN END -RUN -*--------------------------------------------------- DEFINE FILE ENRLAGGN SOURCE/A4 = 'ENRL'; END TABLE FILE ENRLAGGN SUM AMOUNT AMOUNTW SOURCE BY FYPW BY LITM1 BY LITM2 BY LITM3 BY UNIT1 BY UNIT2 ON TABLE HOLD AS ENRLAGG0 FORMAT FOCUS END -RUN ?FF ENRLAGG0 !type enrlagg0.mas -RUN -SET &TIME=HHMMSS('A8'); -TYPE ********** FTE End Data Pull - Timestamp: &DATEYYMD &TIME
first section on the code in orignal email is from settings fex that is where we are populating the variables.