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] EDIT function stopping at comma

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] EDIT function stopping at comma
 Login/Join
 
Platinum Member
posted
I want the fist 48 characters of STUNAME2, including the commas. EDIT seems to be stopping at the first comma it sees. Is that right? Any other ideas?

The example below probably isn't going to look to good, but you can see that STUNAME2 has 'N, Hall' and what STU)NAME has is 'N,'

This happens with 7.6.8 and 7.6.10 Dev. Studio with 7.6.11 server

 
DEFINE FILE SPRIDEN
STUNAME2/A185 = SPRIDEN_LAST_NAME||', '|SPRIDEN_FIRST_NAME||' '|SPRIDEN_MI;
STU_NAME/A48 = EDIT(STUNAME2,'999999999999999999999999999999999999999999999999');
END
TABLE FILE SPRIDEN
PRINT 
STUNAME2
SPRIDEN_LAST_NAME
SPRIDEN_FIRST_NAME
SPRIDEN_MI
STU_NAME
IF RECORDLIMIT EQ 100
END
 


STUNAME2 SPRIDEN_LAST_NAME SPRIDEN_FIRST_NAME SPRIDEN_MI STU_NAME
N, Hall N Hall . N,
Den, Lennox Den Lennox . Den,

This message has been edited. Last edited by: Rick Man,


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Expert
posted Hide Post
Try changing EDIT to SUBSTR


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
<JG>
posted
That's a bug.

Raise a case with IBI.

It works correctly in 7.7.0.3 (They'll tell you to upgrade)
 
Report This Post
Platinum Member
posted Hide Post
Thanks WAZ; however that didn't work either. The plot thickens. What I think is happening is that the strong concatenation isn't working, or at least the way I thought it would. So what it is actually doing is taking th e48 bytes out of the 60 byte LAST_NAME field. Making it appear that it isn't working. When I change to use the parenthesis to concatenate the comma and blank it works. I'll paste the HTML output but it'll be ugly. ASTU_NAME and BSTU_NAME are the output fields.

I am confused about how strong comcatenation works though.


 
DEFINE FILE SPRIDEN
ASTUNAME2/A185 = SPRIDEN_LAST_NAME ||(', '| SPRIDEN_FIRST_NAME) ||(' '|SPRIDEN_MI);
BSTUNAME2/A185 = SPRIDEN_LAST_NAME ||', '| SPRIDEN_FIRST_NAME ||' '|SPRIDEN_MI;
ASTU_NAME/A48 = EDIT(ASTUNAME2,'999999999999999999999999999999999999999999999999');
BSTU_NAME/A48 = EDIT(BSTUNAME2,'999999999999999999999999999999999999999999999999');
STU_NAME2/A48 = SUBSTR(185, ASTUNAME2, 1, 185, 48, STU_NAME2);
END
TABLE FILE SPRIDEN
PRINT
ASTUNAME2
BSTUNAME2
SPRIDEN_LAST_NAME
SPRIDEN_FIRST_NAME
SPRIDEN_MI
ASTU_NAME
BSTU_NAME
STU_NAME2
IF RECORDLIMIT EQ 100
END

 


ASTUNAME2 BSTUNAME2 SPRIDEN_LAST_NAME SPRIDEN_FIRST_NAME SPRIDEN_MI ASTU_NAME BSTU_NAME STU_NAME2
N, Hall N, Hall N Hall . N, Hall N, N, Hall
Den, Lennox Den, Lennox Den Lennox . Den, Lennox Den, Den, Lennox
Cozort, Claudia Marie Cozort, Claudia Marie Cozort Claudia Marie Cozort, Claudia Marie Cozort, Cozort, Claudia Marie
Aiden, White Aiden, White Aiden White . Aiden, White Aiden, Aiden, White
Allen Eleanor, Inc., Allen Eleanor, Inc., Allen Eleanor, Inc. . . Allen Eleanor, Inc., Allen Eleanor, Inc., Allen Eleanor, Inc.,


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Guru
posted Hide Post
Have you tried the SQUEEZ function?


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Virtuoso
posted Hide Post
quote:
STUNAME2/A185 = SPRIDEN_LAST_NAME||', '|SPRIDEN_FIRST_NAME||' '|SPRIDEN_MI;

Yes! In the above code,

SPRIDEN_LAST_NAME||', '
moves the comma to the point where the trailing blanks in the Last Name value begin, followed by all the original trailing blanks.

|SPRIDEN_FIRST_NAME
then appends the First name field to the result so far -- meaning, after those trailing blanks.You can figure out the rest.

How did well all miss that?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
<JG>
posted
quote:
How did well all miss that?

More to the point is how did IBI's QA miss that.
 
Report This Post
Platinum Member
posted Hide Post
SQUEEZ may work, but when you're focused on what you've used to all your FOCUS/WebFOCUS life you expect it to work. It appears that the line is evaluated/interpreted right to left rather than left to right.

Maybe an IBIer will pick this up and help explain it.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Virtuoso
posted Hide Post
quote:
STUNAME2/A185 = SPRIDEN_LAST_NAME||', '|SPRIDEN_FIRST_NAME||' '|SPRIDEN_MI;


@Rick: No, it's left to right.

@JG: My point was that the result Rick got is correct, and we (not QA) dozed off.


The output of the hard concat operator (||) has the same length as soft concat (|) -- viz., the sum of lengths of its two operands; the only difference is the placement of the characters: || shifts the trailing blanks of its first operand to the end of its result, | does not. This is true of intermediate results, as well as the final result.

When the result of || is used as first operand of |, as in
D = A || B | C
, which is equivalent to
D = (A || B) | C
, the trailing blanks from the particular values of A and B will be placed immediately before the value of C -- and the content of C will in fact have a fixed position in the result, regardless of the content of A and B.

To keep the visible content of A, B, and C together (i.e., to keep all their trailing blanks "trailing" in the result), you have to keep using hard catenation. So Rick can get the desired result with
STUNAME2/A185 = 
             SPRIDEN_LAST_NAME 
  || (', ' | SPRIDEN_FIRST_NAME)
  || (' '  | SPRIDEN_MI);
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
@Jack: Spot on.

Good One


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
Platinum Member
posted Hide Post
Thanks Jack.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report 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] EDIT function stopping at comma

Copyright © 1996-2020 Information Builders