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] Format I10% in stylesheet

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Format I10% in stylesheet
 Login/Join
 
Platinum Member
posted
Hello,
Is there a way to set the format of a variable in the stylesheet... something like:

...
$
TYPE=DATA,
COLUMN=BUDGET_DIFF,
FORMAT=I10%,
WHEN=FLAG EQ 'E',
$
...

Reason I have to do it in the stylesheet is because my last table file statement uses MORE to stack 10 held files together. Apparently all the columns have
to be in the same format in order to MORE them all together. That is fine for 9 of them... but the tenth needs to be a percent. Any help? Thanks!

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


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Expert
posted Hide Post
Mark,

Use "formatting on the fly" -
PRINT COMPUTE PCTFMT/A6 = IF FLAG NE 'E' THEN 'I9' ELSE 'I9%'; NOPRINT
      BUDGET_DIFF/PCTFMT AS 'something'
etc. etc.
... or something like that. No DS test it!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
You're not going to get around the MORE problem - the fields MUST be the exact same format for the columns in order to work properly.

If you're just wonderabout the display format, you can't do it in a stylesheet, but you CAN do it in a DEFINEd field:

FMT/A5=IF FLAG EQ 'E' THEN 'I10%' ELSE 'I10';
BUDGET_DIFF/FMT=.........


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
I think you have to DEFINE the "format" column, then use it in another DEFINE or COMPUTE - this is an example from the doc:

DEFINE FILE CAR
MYFORMAT/A8=DECODE COUNTRY ('ENGLAND' 'P15.3C' 'JAPAN' 'P15.0' ELSE 
'P15.2M');
END
TABLE FILE CAR
SUM SALES/MYFORMAT BY COUNTRY
END


See Creating Reports With WebFOCUS Language > Creating Temporary Fields > Defining a Virtual Field


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
Expert
posted Hide Post
Good ol' Francis, ready with the documentation reference!

If I remember correctly, the format of A8 is important so my example and Darin's example of A5 and A6 might not work? Someone test it?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Now that you mention it, I do remember that somewhere in the back corner of consciousness. I think it has to be at least A8 but can be longer (although I don't know why it would need to be for practical purposes.) Anything less gives an error (FOC253) INVALID FORMAT SPECIFICATION ON LEFT HAND SIDE


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
Thank you to all! This is what I needed...


Windows version 768
 
Posts: 215 | Registered: March 16, 2006Report This Post
Member
posted Hide Post
I am trying the techinique about to format on the fly, but I am getting the FOC253 error. Here is my code:
-SET &COUNTER = 25 ;
-STARTLOOP
COMPUTE ARD_24/A240 = GETTOK(PARARD, 3500, &COUNTER,'%', LINELEN, ARD_24);
COMPUTE RDLEN/I4 = ARGLEN(2000, (LAST RD_24), RDLEN);
COMPUTE RDALEN/A8 = 'A'||EDIT(RDLEN);
COMPUTE RD_24B/RDALEN = LAST RD_24;
COMPUTE RD_24/A1240V = (RD_24A)||(RD_24B);
-SET &COUNTER = &COUNTER + 1 ;
-IF &COUNTER GT 50 GOTO ENDLOOP ;
-GOTO STARTLOOP
-ENDLOOP

I am trying to do some recursive concatenation.

Any ideas to why I am getting the FOC253 as referenced above? I tried to do this all in the DEFINE, but also got the error. Hoped it would go away as COMPUTEs. This is the only error I am recieved.

TIA


Mitch
prod/test WF 7.6.9 WIN
 
Posts: 15 | Location: Orlando, FL, USA | Registered: December 03, 2003Report This Post
Master
posted Hide Post
First open a new issue. Because this one is marked solved a lot of people will skip over it.

Second change your -STARTLOOP and -GOTO STARTLOOP with
-REPEAT MYLOOP 25 TIMES
-MYLOOP (THIS CAN BE ANY NAME

Third, I don't see an RD_24A in your code is it in you input file and if so how big is it?

Last - Try commenting out the individual computes so you will know which one is giving the error.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report 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] Format I10% in stylesheet

Copyright © 1996-2020 Information Builders