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] Special Character ('/') in a sum field

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Special Character ('/') in a sum field
 Login/Join
 
Member
posted
Hi All,

I created a hold table(HOLD1) from an existing table(TABLE1). I used an across field called 'YEAR' -- its format is 2005/06, 2006/07, etc. Then in the HOLD1, I'd like to sum the field '2005/06'. But I got an error message as shown below.

It's okay to use other fields, and it's also okay to use "PRINT *". So I'm guessing it's because of the special character '/'. Is there anyway to use '2005/06' explicitly?

Thanks in advance.

----- CODE

SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
TABLE FILE TABLE1
SUM
COUNT AS ''
BY DEPARTMANT
ACROSS LOWEST YEAR AS ''
ON TABLE NOTOTAL
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END


TABLE FILE HOLD1
SUM
2005/06
BY DEPARTMANT
ON TABLE NOTOTAL
END

----- ERROR Message

0 NUMBER OF RECORDS IN TABLE= 601 LINES= 78
0 ERROR AT OR NEAR LINE 24 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: 2005/06
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 21 | Registered: October 16, 2012Report This Post
Expert
posted Hide Post
Try removing the "AS ''" from the code - because you have (and need) ASNAMES=ON, those AS statements cause fields with no names in the HOLD file. Without "AS ''", the ACROSS statement will take the first three letters of the COUNT field name and create proper ACROSS field names, eg. COU200504.


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
Jenny,

1. I wouldn't want to have a field named COUNT
2. Check the HOLD1.mas and see what are the field names


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
Member
posted Hide Post
Thank you for your reply. I tried three ways, and it still doesn't work.

1. Francis: I removed all those 'AS', but the generated across field names still contain '/', eg: COU2005/06, and it causes the same error message.

2. Danny: I changed the COUNT to HEADCNT, and here is the output of HOLD1.mas and HOLD1.ftm:

0 NUMBER OF RECORDS IN TABLE= 83 LINES= 11
FILENAME=HOLD1 , SUFFIX=FIX , IOTYPE=STREAM, $
SEGMENT=HOLD1, SEGTYPE=S1, $
FIELDNAME=DEPARTMENT, ALIAS=E01, USAGE=A255V, ACTUAL=A255W,
MISSING=ON, $
FIELDNAME=HEA2005/06, ALIAS=E02, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2006/07, ALIAS=E03, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2007/08, ALIAS=E04, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2008/09, ALIAS=E05, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2009/10, ALIAS=E06, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2010/11, ALIAS=E07, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2011/12, ALIAS=E08, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
FIELDNAME=HEA2012/13, ALIAS=E09, USAGE=D12, ACTUAL=A12,
MISSING=ON, $
000064Department1
2891 3792 2679 2671 2889 3455 4308 5680

3. I also tried to use escape character(%2F for SLASH) OR CTRAN function to include a special character as follows:

SUM 2005%2F06

or

SPACE/A1 = HEXBYT(32, 'A1');
SLASH/A1 = CTRAN(10, SPACE, 32, 47, 'A1');
SUM 2005SLASH06

Any other ideas?


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 21 | Registered: October 16, 2012Report This Post
Expert
posted Hide Post
This is interesting, I was going to suggest wrapping the fields in quotes. but it also does not work


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Is it possible that your "YEAR" field is not a "smart-date" field, but an alpha field where you concatenated the Year and Month with a slash in between?

What is the format of YEAR or what is the format of the field you derived YEAR from?


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

YEAR is a SQL DB field that has the type char(7), and its values in DBs are '2005/06', '2006/07' etc, where '2005/06' means fiscal year 2005 to 2006. When I across the YEAR in the first table, I got all its values in the HOLD file, so I guess it's not a derived field.

Jenny


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 21 | Registered: October 16, 2012Report This Post
Virtuoso
posted Hide Post
Define a newyear field

NEWYEAR/A6=EDIT(YEAR,'9999$99');




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, 2006Report This Post
Expert
posted Hide Post
Can you change the field to something else like '2005 to 06'.

e.g.
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
DEFINE FILE CAR
FINYEAR/A7 = DECODE SEATS(2 '2006/07' 4 '2007/08' ELSE '2008/09') ;
FinYear/A10 = EDIT(FINYEAR,'9999$ to 99') ;
END
TABLE FILE CAR
SUM
SALES AS ''
BY COUNTRY
ACROSS FinYear
ON TABLE HOLD AS TEST
END
-RUN
! type test.mas
TABLE FILE TEST
PRINT
'2006 to 07'
'2007 to 08'
'2008 to 09'
BY COUNTRY
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
quote:
Define a newyear field


Too Quick.....


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
This solution worked perfectly. Thank you very much for all your answers!

Just one more question, I thought both space and slash are special characters, why PRINT '2006 to 2007' works but PRINT '2006/07' doesn't work?


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 21 | Registered: October 16, 2012Report This Post
Expert
posted Hide Post
This is something that IBI may have to answer.
But my guess is that it is related to the order of processing somewhere in WebFOCUS.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
It is because the / is used to separate a field from its format... and a number is not a valid format...


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
Expert
posted Hide Post
Its a pity that it doesn't ignore the slash when you wrap the field in quotes.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Waz,
quote:
TABLE FILE TEST
PRINT
'2006 to 07'
'2007 to 08'
'2008 to 09'
BY COUNTRY
END

If the quotes would disable the /format what would you do with your example if you wanted to change the format? I know, use COMPUTE or DEFINE. Still...


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
I'd say that if there is a field name that matches the bit after the slash, then WF shouldn't interpret that bit as a format. But that's not watertight either.

I think the real issue is with how WF does quoting of fields. If it would expect quote around separate parts of a field path, errors like these couldn't occur. You'd get
PRINT
   'TABLE1'.'SEG01'.'2006/07'/A7
   'TABLE1'.'SEG01'.'2006/07'

-* or maybe
   'TABLE1.SEG01.2006/07'/A7
   'TABLE1.SEG01.2006/07'

-* instead of (ambiguous)
   'TABLE1.SEG01.2006/07/A7'
   'TABLE1.SEG01.2006/07'

Doesn't that make more sense than the current implementation?
Better yet, in SQL it's customary to use double-quotes (") to quote identifiers, so the distinction is immediately clear. It's a standard there, it would make sense to copy that over.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Yes, the quotes should deliniate the field, then normal coding follows.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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] Special Character ('/') in a sum field

Copyright © 1996-2020 Information Builders