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.
We currently have FOCUS 7.6.11 on the mainframe, and I was wanting to show numeric values with either the + or - sign preceeding the value. The minus sign is no problem is the number is negative, but I haven't found a way to show the plus sign in front of positive values. I need the +/- for the following code:
AND COMPUTE ABOVE_BELOW/I4C = (ALL3 - (.05 * SCOREDRCP)); AS ' CASES, ABOVE,/BELOW, 5.0%'
Thanks,
CarrollThis message has been edited. Last edited by: Kerry,
FOCUS 7.6.11 for Mainframe z/OS - DB2 & Flat Files Developer Studio 7.6.4 Windows XP Professional SP 2 Output: Excel, PDF
Seems like you might have to do this in 2 steps. 1 - Calculate the value as a numeric. 2 - DEFINE a variable with the value and append the plus/minus to produce an alpha value for reporting.
Would this example be of help? (the define is just to generate a negative number)
JOIN COUNTRY IN COUNTRIES TO ALL COUNTRY IN CAR AS J1
DEFINE FILE CAR
CHAIRS/I5 = IF COUNTRY EQ 'ENGLAND' THEN -SEATS ELSE SEATS;
END
TABLE FILE CAR
SUM SALES CHAIRS
COMPUTE PM/A6 = IF CHAIRS LT 0 THEN '-' || LJUST(5,PTOA(ABS(CHAIRS), '(P5)', 'A5'),'A5') ELSE
IF CHAIRS EQ 0 THEN '0' ELSE '+' || LJUST(5,PTOA(CHAIRS, '(P5)', 'A5'),'A5');
BY COUNTRY
END
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
I'm sure there is a faster/easier/better way to do this, but here is what I'm talking about:
DEFINE FILE CAR
MY_VARIANCE/I8 = SALES - 1000;
DISP_VAR2/A20 = EDIT(MY_VARIANCE);
DISP_VAR1/A20 = TRIM('L', DISP_VAR2, 20, '0', 1, 'A20');
DISP_VAR/A21 = IF MY_VARIANCE GT 0 THEN '+' | DISP_VAR1 ELSE IF MY_VARIANCE LT 0 THEN '-' | DISP_VAR1 ELSE DISP_VAR1;
END
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
MY_VARIANCE
DISP_VAR2
DISP_VAR1
DISP_VAR
END
Let's think NFR. (It's about time IBI provided this)
Suggestions for how to specify this type of decoration on numeric formats:
+ suffix: P10C+ D12.2+ + infix: D+12.2 P suffix: D12.2P
Use of "+" does not create any problem in DEFINE, COMPUTE, MFD, or final argument of a function. Even in reformatting a column in TABLE, /format never occurs within a numeric expression (else / could not be used in the first place!).
Any other suggestions?
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
If (distant) memory serves, COBOL provides Display options for leading or trailing minus or sign (plus/minus). Obviously the business need existed, so why not fill the void?
Since using + and - in a FOCUS format does not create syntactic ambiguity, I suggest...
leading minus : xn or x-n (the latter just for consistency with the 3 forms below)
leading sign (+/-) : x+n
trailing minus : xn-
trailing sign : xn+
(where x=numeric format letter[I or P or D or F], and n=their numeric format spec)
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I agree that this should be a numeric display option. I realize that even with the excellent coding examples, there are still other issues, such as, the complexity of adding a comma for numbers over 999, and coming up with an alpha replacement for a recompute.
Thanks for the discussion. I appreciate the input.
Carroll
FOCUS 7.6.11 for Mainframe z/OS - DB2 & Flat Files Developer Studio 7.6.4 Windows XP Professional SP 2 Output: Excel, PDF
You might be able to use this trick from previous Forum posts. Set the currency symbol to '+' and then dynamically set the output format to display/hide the currency symbol based on whether the value is positive or negative.
TABLE FILE CAR
PRINT
COMPUTE AMOUNTX/D8 = IF (COUNTRY LIKE 'IT%' OR 'JA%') THEN RETAIL_COST ELSE (-1 * RETAIL_COST); NOPRINT
COMPUTE FORMATX/A8 = IF (AMOUNTX LT 0) THEN 'D8' ELSE 'D8M'; NOPRINT
AMOUNTX/FORMATX
BY CAR
ON TABLE SET CURRSYMB '+'
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007