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     LCWORD Function Problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
LCWORD Function Problem
 Login/Join
 
Silver Member
posted
I am having problems with the LCWORD function. My report has worked fine for ages formatting an UPPER case address into proper case and now it is doing something rather strange.

Each row of the report has 1 address split up into 5 components. If the length of the text in the next row is less than the row above, the remainder from the row above is appended onto the end of the text.

e.g row 1 is "Chelmsford Road"
row 2 should be "West Vale"
row 2 is "West Valed Road"

What is happening (and why now when this project is finished!!)

Many Thanks


DevStudio 7.6.1. SQL Server 2005
 
Posts: 31 | Location: Basingstoke - England | Registered: September 17, 2007Report This Post
Expert
posted Hide Post
This seems to be working:
DEFINE FILE CAR
LC_COUNTRY/A10=LCWORD(10,COUNTRY,LC_COUNTRY);
END
TABLE FILE CAR
PRINT LC_COUNTRY
BY COUNTRY
END  

Can you post your code? Or repro with CAR or EMPLOYEE?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
Just out of curiosity, did something get upgraded recently - WebFOCUS, SQL Server?


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
Silver Member
posted Hide Post
I extract the data from the database with this code
TABLE FILE MBC_BILLINGBILL
BY CUSTOMERACCOUNTNUMBER
BY SITEADDRESS1
BY SITEADDRESS2
BY SITEADDRESS3
BY SITEADDRESS4
BY SITEPOSTCODE
BY SERVICEACCOUNTNUMBER
BY METERPOINTNUMBER
BY BILLSTARTDATE
BY BILLENDDATE
BY BILLTYPE
BY SERVICEACCOUNTSTATEMENTID AS SASID
-SET &COUNTER = 1;
WHERE CUSTOMERACCOUNTNUMBER EQ &CANUMBER
-IF &CANUMBER0.EXISTS THEN GOTO STARTLOOPB ELSE GOTO DONEB;
-STARTLOOPB
-REPEAT LOOPB WHILE &COUNTER LT &CANUMBER0;
-SET &COUNTER = &COUNTER + 1;

OR &CANUMBER.&COUNTER

-LOOPB
-DONEB
WHERE (BILLDATE GE DT(&DATESTART)) AND (BILLDATE LE DT(&DATEEND));
ON TABLE HOLD AS Z_BULK&CURUSER FORMAT FOCUS INDEX SERVICEACCOUNTSTATEMENTID
END

-RUN  


There is a little loop in there that processes more that one CANUMBER and when I view this data it is fine.

I then have this define file
DEFINE FILE Z_P1&CURUSER
CUSTOWNREF/A1 = '';
MULTIMPANS/A1 = '';
ADJUST/A1 = '';
BTOTAL/D20.2 = BEFORETAX + TAX;
SITE1/A100 = LCWORD(100, SITEADDRESS1, SITE1);
SITE2/A100 = LCWORD(100, SITEADDRESS2, SITE2);
SITE3/A100 = LCWORD(100, SITEADDRESS3, SITE3);
SITE4/A100 = LCWORD(100, SITEADDRESS4, SITE4);
-*SITE1/A100 = SITEADDRESS1;
-*SITE2/A100 = SITEADDRESS2;
-*SITE3/A100 = SITEADDRESS3;
-*SITE4/A100 = SITEADDRESS4;
ESTIMATEIND/A1 = IF ESTIMATE EQ 'E' THEN 'Y' ELSE '';
CAHALF1/A9=EDIT(INT(CUSTOMERACCOUNTNUMBER / 100000));
CAHALF2/A9=EDIT(CUSTOMERACCOUNTNUMBER - (EDIT(CAHALF1) * 100000));
CANUMBER/A11=SUBSTR(9, CAHALF1, 5, 9, 5, 'A5') | ' ' | SUBSTR(9, CAHALF2, 5, 9, 5, 'A5');
MPAN/D13c = METERPOINTNUMBER;
BILLSTARTDATEF/DMTYY = HDATE(BILLSTARTDATE, 'DMTYY');
BILLENDDATEF/DMTYY = HDATE(BILLENDDATE, 'DMTYY');
SCHARGE/D20.2Sc = STANDINGCHARGE;
END  


As you can see there are some commented SITE defines. If I use them I dont get the error.

The final table file is
 TABLE FILE Z_P1&CURUSER
PRINT
CUSTOMERNAME AS 'Customer name'
CANUMBER AS 'CA No'
CUSTOWNREF AS 'Cust Own Ref'
SITE1 AS 'Address 1'
SITE2 AS 'Address 2'
SITE3 AS 'Address 3'
SITE4 AS 'Address 4'
SITEPOSTCODE AS 'Postcode'
SERVICEACCOUNTNUMBER AS 'Service Acc No'
............
ON TABLE PCHOLD FORMAT EXL2K
END 


Hope this will shed some light. I have spoken to the guys that manage the WebFOCUS server and nothing has been updated recently apart from us going to British Summer Time.

Many Thanks


DevStudio 7.6.1. SQL Server 2005
 
Posts: 31 | Location: Basingstoke - England | Registered: September 17, 2007Report This Post
Expert
posted Hide Post
Are the SITEADDRESS columns 100 characters?

I don't think this will make a difference, but try changing the syntax a bit:

SITE1/A100 = LCWORD(100, SITEADDRESS1, 'A100');


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
Silver Member
posted Hide Post
Your right. It did not make a difference!

The field is set up on the master file as an A100V. I have tried changing the definition to A100V also and that didn't work either.


DevStudio 7.6.1. SQL Server 2005
 
Posts: 31 | Location: Basingstoke - England | Registered: September 17, 2007Report This Post
Expert
posted Hide Post
Here is one I did with EMPLOYEE that looks a lot like yours and I didn't have any problems.
DEFINE FILE EMPLOYEE
LC_LNAME/A10=LCWORD(10,LAST_NAME,LC_LNAME);
SITE1/A20=LCWORD(20,ADDRESS_LN1,SITE1);
SITE2/A20=LCWORD(20,ADDRESS_LN2,SITE2);
SITE3/A20=LCWORD(20,ADDRESS_LN3,SITE2);
END
TABLE FILE EMPLOYEE
PRINT LC_LNAME 
ADDRESS_LN1 SITE1 AS 'Address 1'
ADDRESS_LN2 SITE2 AS 'Address 2'
ADDRESS_LN3 SITE3 AS 'Address 3'
BY EMP_ID
ON TABLE PCHOLD FORMAT EXL2K
END

quote:
As you can see there are some commented SITE defines. If I use them I dont get the error.

And I don't understand this. If you uncomment those lines, you would override the LCWORD defines. Please explain further.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
The issue is with the A100V columns - I don't think some of the string functions work well with variable length fields. Special functions exist for these: LENV, LOCASV, POSITV, SUBSTV, TRIMV, UPCASV. No Mixed Case though (at least not in v5.3.2 - check your manual for your version).


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
You may be able to define a A100 field and then apply the function to the defined field:

SITE4X/A100 = SITEADDRESS1;
SITE4/A100 = LCWORD(100, SITE4X, SITE4);


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
Silver Member
posted Hide Post
If I change the defines so that SITE1 does not use the LCWORD function, the error does not appear. I left those there so that you could see what I have done to locate the error.

I suppose I should log a fault with InfoBuilders because if you 2 are not sure what is wrong I reckon it is broken.

Many Thanks


DevStudio 7.6.1. SQL Server 2005
 
Posts: 31 | Location: Basingstoke - England | Registered: September 17, 2007Report This Post
Silver Member
posted Hide Post
Thanks for the info in the V thing. I have taking that out of the master file and it has worked. I seem to remember something about that in the past, but in all honesty it was over 6 months ago and I haven't worked on WebFOCUS for 4 months!

Looks like the answer is always in the forum.

Cheers


DevStudio 7.6.1. SQL Server 2005
 
Posts: 31 | Location: Basingstoke - England | Registered: September 17, 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     LCWORD Function Problem

Copyright © 1996-2020 Information Builders