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.
I am trying to add in three columns, based solely on getting the previous month's data to display. I am not sure the correct steps to take at this point. So, if you could direct me into what steps I have to take and codes I must include that would be super!! below is the code:
-**************************
-SET &ECHO=ALL;
JOIN EC_CONTRACT_INDEX.CONTRACT_ID IN EC_CONTRACT_INDEX TO ALL EC_LINE_ITEM.CONTRACT_ID IN EC_LINE_ITEM AS J1 END
JOIN EC_LINE_ITEM.CONTRACT_ID AND EC_LINE_ITEM.MOD_ID IN EC_CONTRACT_INDEX TO ALL EC_CONTRACT.CONTRACT_ID AND EC_CONTRACT.MOD_ID IN EC_CONTRACT AS J99 END
TABLE FILE EC_CONTRACT_INDEX SUM DIVISION_NUMBER PROGRAM_NUMBER CONTRACT_VALUE BY CONTRACT_ID BY HIGHEST 1 EC_LINE_ITEM.MOD_ID BY COST_ACCUMULATOR_ID WHERE DIVISION_NUMBER EQ '08' WHERE UNIT_PRICE_BASIS NE 'UE' WHERE STATUS NE 'X'
WHERE RECORDLIMIT EQ 1000 WHERE READLIMIT EQ 10000 -*ON TABLE PCHOLD FORMAT HTML
ON TABLE HOLD AS HOLD END
-* JOIN HOLD.CONTRACT_ID AND HOLD.MOD_ID AND HOLD.COST_ACCUMULATOR_ID IN HOLD TO ALL EC_COST_ACCUMULATOR.CONTRACT_ID AND EC_COST_ACCUMULATOR.MOD_ID AND EC_COST_ACCUMULATOR.COST_ACCUMULATOR_ID IN EC_COST_ACCUMULATOR AS J3 END -* DEFINE FILE HOLD FP=IF CONTRACT_TYPE EQ 'FACL' OR 'FFP' OR 'FPDQ' OR 'FPEF' OR 'FPIQ' OR 'FPLE' OR 'FPPR' OR 'FPRQ' OR 'FPRR' OR 'LBHR' OR 'SFP' THEN CONTRACT_VALUE ELSE 0; FPI=IF CONTRACT_TYPE EQ 'FPIA' OR 'FPIF' OR 'FPIS' THEN CONTRACT_VALUE ELSE 0; CP=IF CONTRACT_TYPE CONTAINS 'CP' OR 'CR' THEN CONTRACT_VALUE ELSE 0; TM=IF CONTRACT_TYPE CONTAINS 'TAM' THEN CONTRACT_VALUE ELSE 0; NA=IF CONTRACT_TYPE EQ 'AOD' OR 'BAA' OR 'BOA' OR 'IDIQ' OR 'NC' OR 'OTA' OR 'UCA' THEN CONTRACT_VALUE ELSE 0;
ADJUST_AMNT/A100 = ' '; MARK_ADJUST/A20 = ' '; ADJUST_EXP/A100 = ' '; ADJUST_COMMT/A100 = ' '; END -* TABLE FILE HOLD SUM DIVISION_NUMBER PROGRAM_NUMBER CONTRACT_VALUE FP FPI CP TM NA COST_ACCUMULATOR_ID BOOKING_ACCUMULATOR
OPT_COM LEVEL_1 LEVEL_2 MAPPING
ADJUST_AMNT MARK_ADJUST ADJUST_EXP ADJUST_COMMT BY CONTRACT_ID BY MOD_ID -*BY BOOKING_ACCUMULATOR NOPRINT
-*ON TABLE PCHOLD FORMAT HTML
ON TABLE HOLD AS HOLD1 END -* JOIN HOLD1.CONTRACT_ID AND HOLD1.MOD_ID IN HOLD1 TO ALL EC_CONTRACT.CONTRACT_ID AND EC_CONTRACT.MOD_ID IN EC_CONTRACT AS J5 END -* TABLE FILE HOLD1 SUM BOOKING_ACCUMULATOR DIVISION_NUMBER FUNDING_SOURCE PROGRAM_NUMBER PROGRAM_PROJECT CONTRACT_NUMBER CONTRACT_TYPE RELEASE_NUMBER TITLE START_DATE COMPLETION_DATE MANAGER_ID FP FPI CP TM NA CONTRACT_VALUE STATUS
OPT_COM LEVEL_1 LEVEL_2 MAPPING
ADJUST_AMNT MARK_ADJUST ADJUST_EXP ADJUST_COMMT BY CONTRACT_ID -*BY BOOKING_ACCUMULATOR WHERE CONTRACT_TYPE NE 'IDIQ' OR 'OTA' OR 'UCA' OR 'BOA' OR 'BAA' ON TABLE HOLD AS HOLD2 END -* JOIN HOLD2.DIVISION_NUMBER AND HOLD2.FUNDING_SOURCE IN HOLD2 TO ALL EC_FUNDING_SOURCE.DIVISION_NUMBER AND EC_FUNDING_SOURCE.FUNDING_SOURCE IN EC_FUNDING_SOURCE AS J7 END -* JOIN HOLD2.MANAGER_ID IN HOLD2 TO ALL EC_USER.USER_ID IN EC_USER AS J9 END -* DEFINE FILE HOLD2 CONTRACT_TYPE_1/A10= IF FP GT CP AND FP GT FPI AND FP GT TM AND FP GT NA THEN 'FP' ELSE IF FPI GT CP AND FPI GT FP AND FPI GT TM AND FPI GT NA THEN 'FPI' ELSE IF CP GT FP AND CP GT FPI AND CP GT TM AND CP GT NA THEN 'CP' ELSE IF TM GT FP AND TM GT FPI AND TM GT CP AND TM GT NA THEN 'TAM' -* IF NA GT FP AND NA GT FPI AND NA GT CP AND NA GT TM THEN 'NA' ELSE ' '; CONTRACT_TYPE_2/A10= IF CONTRACT_TYPE_1 NE ' ' THEN CONTRACT_TYPE_1 ELSE CONTRACT_TYPE; APPROVE/A10=IF STATUS EQ 'A' THEN 'Approved' ELSE IF STATUS EQ 'I' OR 'W' THEN 'WIP' ELSE ' '; NAME/A35 = LAST_NAME || (', '|FIRST_NAME); START_DATE/MDYY = HDATE(START_DATE, 'MDYY'); COMPLETION_DATE/MDYY = HDATE(COMPLETION_DATE, 'MDYY'); -* today's date TODAY/MDYY=&MDYY; TOT_VALUE/D16.2 = FP + FPI+ CP+ TM
-* trying to create a display right now for the previous month, when I uncomment -*the code below...it will get you the debuggin code you see on the bottom -* -*-SET &CALCDTE = EDIT (&START_DATE); -*-SET PREV_MON = SUBSTR(&CALCDTE.LENGTH, &CALCDTE, 1, 2, 2, 'A2'); -*-SET PREV_DATE = IF PREV_MON EQ '01' THEN '12' -*-ELSE IF PREV_MON EQ '02' THEN '01' -*-ELSE IF PREV_MON EQ '03' THEN '02' -*-ELSE IF PREV_MON EQ '04' THEN '03' -*-ELSE IF PREV_MON EQ '05' THEN '04' -*-ELSE IF PREV_MON EQ '06' THEN '05' -*-ELSE IF PREV_MON EQ '07' THEN '06' -*-ELSE IF PREV_MON EQ '08' THEN '07' -*-ELSE IF PREV_MON EQ '09' THEN '08' -*-ELSE IF PREV_MON EQ '10' THEN '09' -*-ELSE IF PREV_MON EQ '11' THEN '10' -*-ELSE EQ '12'; -* END -* TABLE FILE HOLD2 HEADING "Sorted and Summed by ECE Unique ID" "Run Date/Time: &DATE &TOD" PRINT DIVISION_NUMBER NOPRINT
OPT_COM AS 'Operating Company'
PROGRAM_PROJECT AS 'Dept' PROGRAM_NUMBER AS 'Product Line' BOOKING_ACCUMULATOR AS 'Master Req'
LEVEL_1 AS 'Level 1' LEVEL_2 AS 'Level 2' MAPPING AS 'Mapping'
CONTRACT_NUMBER AS 'Contract Number' RELEASE_NUMBER AS 'DO Number' TITLE AS 'Title' START_DATE AS 'POP Start' COMPLETION_DATE AS 'POP End' NAME AS 'Name' -*CONTRACT_TYPE_1 AS 'Contract Type' CONTRACT_TYPE_2 AS 'Contract Type' DESCRIPTION AS 'Funded By' FP/D16.2CM AS 'Fixed Price Order Value' FPI/D16.2CM AS 'Fixed Price Incentive Order Value' CP/D16.2CM AS 'Cost Type Order Value' TM/D16.2CM AS 'Time and Materials Order Value' NA/D16.2CM AS 'NA Order Value' CONTRACT_VALUE/D16.2CM AS 'Order Value' TOT_VALUE/D16.2CM AS 'Order Value Calc'
-* AS 'Previous Month Orders Value Calc' -* AS 'Prelim Month Orders' ADJUST_AMNT AS 'Adjustment Amount' MARK_ADJUST AS 'Mark(s) for Adjustments' -* AS 'Total Previous Month 2008 Orders' ADJUST_EXP AS 'Adjustment Explanation' ADJUST_COMMT AS 'Adjustment Comment'
-*APPROVE AS 'Approved/WIP' -*TODAY AS 'Run Date' BY CONTRACT_ID AS 'ECE Unique ID' BY CONTRACT_NUMBER NOPRINT BY RELEASE_NUMBER NOPRINT -*BY BOOKING_ACCUMULATOR NOPRINT WHERE BOOKING_ACCUMULATOR NE '???' OR 'NOBILL' WHERE APPROVE NE 'WIP' WHERE RECORDLIMIT EQ 100 WHERE READLIMIT EQ 100 ON TABLE PCHOLD FORMAT HTML -*ON TABLE PCHOLD FORMAT EXCEL END -EXIT
-***********************************************
0 NUMBER OF RECORDS IN TABLE= 330645 LINES= 1 0 ERROR AT OR NEAR LINE 19 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: CALCDTE 0 ERROR AT OR NEAR LINE 20 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: CALCDTE.LENGTH 0 ERROR AT OR NEAR LINE 21 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: PREV_MON 0 ERROR AT OR NEAR LINE 45 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC003) THE FIELDNAME IS NOT RECOGNIZED: PREV_DATE BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
Thank you in advanceThis message has been edited. Last edited by: Kerry,
And you've got an extra EQ on the last line. This works:
-SET &CALCDTE = EDIT (&START_DATE);
-SET &PREV_MON = SUBSTR(&CALCDTE.LENGTH, &CALCDTE, 1, 2, 2, 'A2');
-SET &PREV_DATE = IF &PREV_MON EQ '01' THEN '12'
-ELSE IF &PREV_MON EQ '02' THEN '01'
-ELSE IF &PREV_MON EQ '03' THEN '02'
-ELSE IF &PREV_MON EQ '04' THEN '03'
-ELSE IF &PREV_MON EQ '05' THEN '04'
-ELSE IF &PREV_MON EQ '06' THEN '05'
-ELSE IF &PREV_MON EQ '07' THEN '06'
-ELSE IF &PREV_MON EQ '08' THEN '07'
-ELSE IF &PREV_MON EQ '09' THEN '08'
-ELSE IF &PREV_MON EQ '10' THEN '09'
-ELSE IF &PREV_MON EQ '11' THEN '10'
-ELSE '12';
PREV_MON/A2 = EDIT('&START_DATE.EVAL,'99'); PREV_DATE/A2 = IF PREV_MON EQ '01' THEN '12' ELSE IF PREV_MON EQ '02' THEN '01' ELSE IF PREV_MON EQ '03' THEN '02' ELSE IF PREV_MON EQ '04' THEN '03' ELSE IF PREV_MON EQ '05' THEN '04' ELSE IF PREV_MON EQ '06' THEN '05' ELSE IF PREV_MON EQ '07' THEN '06' ELSE IF PREV_MON EQ '08' THEN '07' ELSE IF PREV_MON EQ '09' THEN '08' ELSE IF PREV_MON EQ '10' THEN '09' ELSE IF PREV_MON EQ '11' THEN '10' ELSE '12';
Since you're in a DEFINE, the DM approach will (in this case) not work. The above code transforms it into fields.
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Yup Thank you Both! I got the report to display, but when I tried to place one of the PREV_DATE as a column that I want to display, I got:
0 NUMBER OF RECORDS IN TABLE= 1000 LINES= 70 (BEFORE TOTAL TESTS) 0 NUMBER OF RECORDS IN TABLE= 10 LINES= 5 0 NUMBER OF RECORDS IN TABLE= 4 LINES= 4 0 ERROR AT OR NEAR LINE 180 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC257) MISSING QUOTE MARKS: ('START_DATE.EVAL,'9 BYPASSING TO END OF COMMAND 0 ERROR AT OR NEAR LINE 244 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC003) THE FIELDNAME IS NOT RECOGNIZED: PREV_DATE BYPASSING TO END OF COMMAND (FOC009) INCOMPLETE REQUEST STATEMENT
If your START_DATE is a smartdate field in the database you can say
DEFINE FILE CAR
START_DATE/MDYY='12152008';
PREVPERIOD/YYMD=DATEMOV(START_DATE, 'BOM')-1;
PREVMONTH/M=PREVPERIOD;
END
The second line moves the start_date field to the first day of the month ( BOM ) and by subtracting 1 you get the last day of the previous month. The next step makes this field to a M month only field.
You can do this in the beginning of your application.
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
DEFINE FILE HOLD FP=IF CONTRACT_TYPE EQ 'FACL' OR 'FFP' OR 'FPDQ' OR 'FPEF' OR 'FPIQ' OR 'FPLE' OR 'FPPR' OR 'FPRQ' OR 'FPRR' OR 'LBHR' OR 'SFP' THEN CONTRACT_VALUE ELSE 0; FPI=IF CONTRACT_TYPE EQ 'FPIA' OR 'FPIF' OR 'FPIS' THEN CONTRACT_VALUE ELSE 0; CP=IF CONTRACT_TYPE CONTAINS 'CP' OR 'CR' THEN CONTRACT_VALUE ELSE 0; TM=IF CONTRACT_TYPE CONTAINS 'TAM' THEN CONTRACT_VALUE ELSE 0; NA=IF CONTRACT_TYPE EQ 'AOD' OR 'BAA' OR 'BOA' OR 'IDIQ' OR 'NC' OR 'OTA' OR 'UCA' THEN CONTRACT_VALUE ELSE 0;
How is this working for you? You don't have formats or field length on these defines.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007