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] Problem when displaying the numeric values in footing

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Problem when displaying the numeric values in footing
 Login/Join
 
Member
posted
Hi All,

I want to display the footing with numeric values. Now i am able to display the values in alpha format, but i want these in D12.2C format.

When i read the data from the hold file it is giving longer data as clubbing two values.

Here is the example.
quote:
-SET &ECHO ='ALL';
-DEFAULT &cntry='';
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
ON TABLE HOLD AS CARHLD FORMAT ALPHA
END
-RUN
-SET &NBR = &LINES;
TABLE FILE CAR
PRINT
'CAR.BODY.SEATS' AS 'SEATS'
'CAR.BODY.DEALER_COST'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"SAL"
FOOTING
-REPEAT L_LOOP1 &NBR TIMES
-READ CARHLD NOCLOSE &CTR.A11. &CAR.16.
" <+0><+0>&CAR<+0>&CTR<+0> "
-L_LOOP1
END


Please help me.........!

Koteswar,
WF76.11,windows xp.

This message has been edited. Last edited by: Kerry,
 
Posts: 23 | Registered: May 20, 2008Report This Post
Gold member
posted Hide Post
The problem is your
-READ 
statement. The Country field is only an A10 and your asking for 11. Also, the Dealer Cost field is only a D7 and your asking for 16 characters. This is why you are receiving values that look like they are concatenated.

Try this.

  
-SET &ECHO ='ALL';
-DEFAULT &cntry='';
TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY 
ON TABLE HOLD AS CARHLD FORMAT ALPHA
END
-RUN
-SET &NBR = &LINES;
TABLE FILE CAR
PRINT
'CAR.BODY.SEATS' AS 'SEATS'
'CAR.BODY.DEALER_COST'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"SAL"
FOOTING
-REPEAT L_LOOP1 &NBR TIMES
-READ CARHLD NOCLOSE &CTR.A10 &CAR.7
" <+0><+0>&CAR<+0>&CTR<+0> "
-L_LOOP1
END


Then work on formatting the Dealer Cost and such in the Footing.


WebFOCUS 7.7.03
Windows Web Server 2008
MS SQL Server 2000
Excel,CSV,PDF,HTML
 
Posts: 71 | Location: Kingston, ON | Registered: May 03, 2011Report This Post
Member
posted Hide Post
Thanks for your advise.

What function should use to convert the format of the value to get d7.2c.

I have tried with ATOBL function but didnt work.

Please help me....!

This message has been edited. Last edited by: Koteswar,
 
Posts: 23 | Registered: May 20, 2008Report This Post
Expert
posted Hide Post
Are Koteswar and koti the same person?

Use -READFILE instead of -READ - you'll never have the wrong format again!

Use FPRINT to change the format of the data.

-SET &ECHO ='ALL';

SET ASNAMES=ON
-RUN

-DEFAULT &cntry='';

TABLE FILE CAR
SUM DEALER_COST
BY COUNTRY
ON TABLE HOLD AS CARHLD FORMAT ALPHA
END
-RUN

-SET &NBR = &LINES;

TABLE FILE CAR
PRINT
'CAR.BODY.SEATS' AS 'SEATS'
'CAR.BODY.DEALER_COST'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'

HEADING
"SAL"

FOOTING
-REPEAT L_LOOP1 &NBR TIMES

-READFILE CARHLD
-SET &DEALER_COSTX = FPRINT(&DEALER_COST, 'D10.2', 'A12');
" <+0><+0>&DEALER_COSTX<+0>&COUNTRY<+0> "
-L_LOOP1
END
-RUN


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
I would use the new READFILE command instead of READ: one does not have to count characters:
  
-* File koteswar01.fex
-SET &ECHO ='ALL';
-DEFAULT &cntry='';
DEFINE FILE CAR
DLCOST/D8.2=DEALER_COST;
END
TABLE FILE CAR
SUM DLCOST
BY COUNTRY 
ON TABLE HOLD AS CARHLD 
END
-RUN
-SET &NBR = &LINES;
TABLE FILE CAR
PRINT
'CAR.BODY.SEATS' AS 'SEATS'
'CAR.BODY.DEALER_COST'
BY 'CAR.COMP.CAR'
BY 'CAR.CARREC.MODEL'
HEADING
"SAL"
FOOTING
-REPEAT L_LOOP1 &NBR TIMES;
-READFILE CARHLD
" <+0> <+0>&COUNTRY<+0>&DLCOST"
-L_LOOP1
-CLOSE CARHLD
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=FOOTING, HEADALIGN=BODY, $
TYPE=FOOTING, ITEM=4, JUSTIFY=RIGHT, $
ENDSTYLE
END 


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Unfortunately it seems as though Koteswar is using WF 7.6.11 (based on the original post) and if my understanding is correct both -READFILE and FPRINT are new features introduced to the product in 7.7.

dburton's suggestion would be the one to follow for now.



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
Expert
posted Hide Post
That is unfortunate.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
That is unfortunate


I know! If there is something really cool that has been added to Dialogue Manager recently, that has to be precisely -READFILE. I haven't used -READ anymore since riding on the 7.7 wagon.



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
Member
posted Hide Post
Hi All,

Thanks for you suggestions.......

I am able to read the values and displaying in Alpha format as per the "dburton" comments. But how can i change the format from Alpha to decimal (D12.2C) to display in footing.

Is there any methods to change or not?

Thanks in advance.....!

Koteswar,
WF 7.6.11, windows xp.
 
Posts: 23 | Registered: May 20, 2008Report This Post
Virtuoso
posted Hide Post
quote:
how can i change the format from Alpha to decimal (D12.2C) to display in footing.


Well, as soon as you've -READ your value into a &variable you'll end up with a string that looks like a number so just use the FTOA function to format that "number" into the pattern you need.

You want to convert an alpha to number but in reality, you'll end up just formatting a "numeric" alpha into a new alpha. Boy, just by reading the latter I got myself confused Confused

Anyway, the fact that you're dealing with numbers or alphas in this case becomes irrelevant in the world of Dialogue Manager.

See this:
-SET &VALUE = '1712599.88';
-SET &VALUE_FMT = FTOA(&VALUE, '(D12.2)', 'A14');
-TYPE &VALUE_FMT

-SET &VALUE = 1712599.88;
-SET &VALUE_FMT = FTOA(&VALUE, '(D12.2)', 'A14');
-TYPE &VALUE_FMT




Number or alpha, the effect is the same. Dialogue Manager is almost type-agnostic, it treats everything as an alpha unless the value "looks" like a number in which case it will dealt with as such, by default.

In addition, D12.2 automatically sticks a comma for every 3rd significant digit so the "C" modifier is unnecessary.



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
Member
posted Hide Post
Thanks for your support and my issue was resolved.
 
Posts: 23 | Registered: May 20, 2008Report This Post
Virtuoso
posted Hide Post
Great!

Would you please edit your original post and prefix its title with [SOLVED] ?



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
Platinum Member
posted Hide Post
We have 7.6.11 FPRINT works great and I use it a lot.

Marilyn


WebFOCUS 8.1.05 Windows 7, all output
 
Posts: 107 | Registered: February 18, 2011Report This Post
Expert
posted Hide Post
ditto to what Marilyn said. FPRINT works just fine in 76




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report 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] Problem when displaying the numeric values in footing

Copyright © 1996-2020 Information Builders