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     [SOLVED] Code Explanation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Code Explanation
 Login/Join
 
Guru
posted
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



-RUN
-READ FYPW &FYPW_0.A7.
-GOTO OTHER_TIMES
-SET_FYPW_0
-SET &FYPW_0 = &YEAR || &PERIOD || &WEEK ;
-*
-OTHER_TIMES
-SET &FYP_0 = EDIT(&FYPW_0, '999999');
-SET &FYP_1 = AYM(&FYP_0, -1, 'I6');
-SET &FYP_2 = AYM(&FYP_0, -2, 'I6');
-SET &FYP_3 = AYM(&FYP_0, -3, 'I6');
-SET &FYP_12 = AYM(&FYP_0, -12, 'I6');
-SET &FYP_13 = AYM(&FYP_0, -13, 'I6');
-*
-SET &W_0 = EDIT(&FYPW_0 , '$$$$$$9');
-SET &W_1 = DECODE &W_0 ( 5 4 4 3 3 2 2 1 1 'FOC_NONE');
-SET &W_2 = DECODE &W_1 ( 4 3 3 2 2 1 1 'FOC_NONE');
-SET &W_3 = DECODE &W_2 ( 3 2 2 1 1 'FOC_NONE');
-SET &W_4 = DECODE &W_3 ( 2 1 1 'FOC_NONE');
-*
-SET &P_0 = EDIT(&FYP_0 , '$$$$99');
-SET &P_1 = EDIT(&FYP_1 , '$$$$99');
-SET &P_2 = EDIT(&FYP_2 , '$$$$99');
-SET &P_3 = EDIT(&FYP_3 , '$$$$99');
-SET &P_12 = EDIT(&FYP_12, '$$$$99');
-SET &P_13 = EDIT(&FYP_13, '$$$$99');
-*
-SET &FY_0 = EDIT(&FYP_0 , '9999');
-SET &FY_1 = EDIT(&FYP_1 , '9999');
-SET &FY_2 = EDIT(&FYP_2 , '9999');
-SET &FY_3 = EDIT(&FYP_3 , '9999');
-SET &FY_12= EDIT(&FYP_12, '9999');
-SET &FY_13= EDIT(&FYP_13, '9999');
-*
-TYPE Inputs
-*-TYPE ===========================
-TYPE REPTYPE = &REPTYPE
-TYPE BRAND = &BRAND
-TYPE DIVISION = &DIVISION
-TYPE DISTRICT = &DISTRICT
-TYPE Criteria
-TYPE ===========================
-TYPE UNIT1_FIELD = &UNIT1_FIELD
-TYPE UNIT1_TITLE = &UNIT1_TITLE
-TYPE UNIT2_FIELD = &UNIT2_FIELD
-TYPE UNIT2_TITLE = &UNIT2_TITLE
-TYPE UNIT1_WHFIELD = &UNIT1_WHFIELD
-TYPE UNIT1_VAL = &UNIT1_VAL
-TYPE BURST = &BURST
-TYPE ---------------------
-TYPE FYPW_0 = &FYPW_0
-TYPE FYP_0 = &FYP_0
-TYPE FYP_1 = &FYP_1
-TYPE FYP_2 = &FYP_2
-TYPE FYP_3 = &FYP_3
-TYPE FYP_12 = &FYP_12
-TYPE FYP_13 = &FYP_13
-TYPE ---------------------
-TYPE W_0 = &W_0
-TYPE W_1 = &W_1
-TYPE W_2 = &W_2
-TYPE W_3 = &W_3
-TYPE W_4 = &W_4
-TYPE ---------------------
-TYPE P_0 = &P_0
-TYPE P_1 = &P_1
-TYPE P_2 = &P_2
-TYPE P_3 = &P_3
-TYPE P_12 = &P_12
-TYPE P_13 = &P_13
-TYPE ---------------------
-TYPE FY_0 = &FY_0
-TYPE FY_1 = &FY_1
-TYPE FY_2 = &FY_2
-TYPE FY_3 = &FY_3
-TYPE FY_12 = &FY_12
-TYPE FY_13 = &FY_13
-TYPE ---------------------

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


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 2010Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
Did you try running the code to see what you get?

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,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Guru
posted Hide Post
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.


WebFOCUS 7.6.10
Windows
HTML
 
Posts: 294 | Registered: March 04, 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     [SOLVED] Code Explanation

Copyright © 1996-2020 Information Builders