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     [CLOSED]Getting hidden characters on truncate

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Getting hidden characters on truncate
 Login/Join
 
Gold member
posted
I am getting the value for region in an amper variable and truncating it to remove trailing spaces.

-READ HOLD, ®ION

-SET ®ION2 = TRUNCATE(®ION);

-TYPE (®ION2.LENGTH)

-*SET ®ION2 = 'US';
-IF ®ION EQ US THEN GOTO :US ELSE IF ®ION EQ Europe THEN GOTO :EMEA ELSE IF ®ION EQ LACC THEN GOTO :LACC ELSE GOTO :JAPA;

However, it seems to have some hidden characters which is why the simplest of If condition is failing.

Length of region post truncate is always 2 more than what it should be.

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8010,8204
Windows
 
Posts: 59 | Registered: June 26, 2015Report This Post
Virtuoso
posted Hide Post
There is no reason that the length impact the test.
If your test fail, it's due to something else.

TABLE FILE CAR
BY COUNTRY AS 'CNTRY'
WHERE COUNTRY EQ 'FRANCE';
-*WHERE COUNTRY EQ 'W GERMANY';
-*WHERE COUNTRY EQ 'ITALY';
ON TABLE HOLD AS HLD FORMAT BINARY
END
-RUN

-READFILE HLD

-IF &CNTRY EQ 'W GERMANY' THEN GOTO :US ELSE IF &CNTRY EQ FRANCE THEN GOTO :EMEA ELSE IF &CNTRY EQ ENGLAND THEN GOTO :LACC ELSE GOTO :JAPA;
-:US
-TYPE TEST RESULT = US, CNTRY: &CNTRY, CNTRY LENGTH: &CNTRY.LENGTH
-GOTO XEND;
-:EMEA
-TYPE TEST RESULT = EUROPE, CNTRY: &CNTRY, CNTRY LENGTH: &CNTRY.LENGTH
-GOTO XEND;
-:LACC
-TYPE TEST RESULT = LACC, CNTRY: &CNTRY, CNTRY LENGTH: &CNTRY.LENGTH
-GOTO XEND;
-:JAPA
-TYPE TEST RESULT = JAPAN, CNTRY: &CNTRY, CNTRY LENGTH: &CNTRY.LENGTH

-XEND

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


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Master
posted Hide Post
quote:
Originally posted by Kartik Katyal:

-IF ®ION EQ US...

Shouldn't "US" have single quotes around it?

Like this:

-IF ®ION EQ 'US'...


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
It does work anyway without the quotes since there is no spaces in the tested value.

In my above sample, it won't work if I will have tested W GERMANY without quotes.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Platinum Member
posted Hide Post
If you do a -TYPE on &ION and &ION.LENGTH both before and after the TRUNCATE what do you see?
 
Posts: 164 | Registered: March 26, 2003Report This Post
Master
posted Hide Post
Instead of READ, have you tried READFILE.. Much easier to use and it doesn't care if your sizing if 1 byte off or not.

-READFILE HOLD
-SET &ION2 = TRUNCATE(&ION);

-TYPE (&ION2.LENGTH)

-*SET &ION2 = 'US';
-IF '&ION' EQ 'US' THEN GOTO :US ELSE IF '&ION' EQ 'Europe' THEN GOTO :EMEA ELSE IF '&ION' EQ LACC THEN GOTO :LACC ELSE GOTO :JAPA;



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Virtuoso
posted Hide Post
quote:
Instead of READ, have you tried READFILE.. Much easier to use

... as long as the column and amper var names match.

I was going to suggest that, and also ask to post the HOLD MASTER file. If the HOLD data are not comma-delimited, then perhaps the comma in the -READ will result in the trailing CR LF becoming part of the value of &REGION


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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     [CLOSED]Getting hidden characters on truncate

Copyright © 1996-2020 Information Builders