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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
MISSING VALUES
 Login/Join
 
Silver Member
posted
I'm concatenating some fields from an Oracle table together to create a new field. Some of the fields are missing. When the field is missing a value it's converting it to a single blank.

FIELDA = 'ABC'
FIELDB = 'DEF'
FIELDC = is missing a value
FIELDD = 'GHI'
NEW_FIELD = FIELDA | FIELDB | FIELDC | FIELDD ;

The result for NEW_FEILD is 'ABCDEF GHI'
I need to have it 'ABCDEFGHI'. I want to find out how other developers have handled this.

Thanks loads,
Jim
 
Posts: 43 | Location: San Jose, California. | Registered: July 18, 2005Report This Post
Guru
posted Hide Post
Would SET NODATA = '' work for you?
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
Expert
posted Hide Post
or a strong concatenation?
FIELDA || FIELDB || FIELDC || FIELDD




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Sadly I don't think that either of the suggestions will work (?) as WF seems to always interpret a missing value in concatenation as a blank space?

It has always been one of the problems when displaying data within FML etc.

Let us know if either suggestion works.

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
<JG>
posted
Jim

If a space should never appear in the output use the STRIP sub routine.

DEFINE FILE CAR
TESTA/A20='abc def ghi jkl';
TESTB/A20= STRIP(20, TESTA, ' ', 'A20');
END
TABLE FILE CAR
PRINT TESTA TESTB
BY COUNTRY
END
-RUN
 
Report This Post
Virtuoso
posted Hide Post
Check Your Master File Description (MFD) to make sure each field has the MISSING=ON attribute. If this is set to OFF or is not there then FOCUS will always substitute a blank or 0 for a null value. The MISSING=ON will force FOCUS to retain the null value and your DEFINE should work. I ran a test with a file using WF 7.1.1 and it worked. No space inbetween values.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Virtuoso
posted Hide Post
quote:
FIELDA || FIELDB || FIELDC || FIELDD


Susannah's suggestion will work if you code it this way:

FIELDA || (FIELDB || (FIELDC || FIELDD))

The parenthesis are very important to make FOCUS perform the concatenation from right to left. I have had problems with this type of concatenation (trailing blanks still appear) when parenthesis were not used.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
ah. what a good point, thanks Mickey.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
That's puzzling. I would expect
((FIELDA || FIELDB) || FIELDC) || FIELDD
and
FIELDA || (FIELDB || (FIELDC || FIELDD))
to yield the same result.

In combining its two operands, || transfers the trailing spaces of the left operand to the tail end of the result, so no matter how you parenthesize all the field's trailing spaces wind up on the extreme right.

In a word, isn't Hard Catenation associative?

Of course, the parentheses do matter when the expression combines hard and soft catenation.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Silver Member
posted Hide Post
Sorry I took so long to reply back to my post. I really appreciate everyone’s feedback. I read everyone’s feed back and this is what I have.

I checked our Master for this table and MISSING=ON is set for ever field. Nulls are still returning a blank. We are on 533. Don't know if that makes a difference. We're in the process of upgrading to 711 and I will check this again once we upgrade.

The problem with the hard concatenation is that
the contents of some of the fields may contain
2 bytes and a blank. The other developer wants the blank there in that case. FIELDB may contain 'DE ' and the developer wants:
"ABCDE FGHI"

The only time the developer wants no blanks is if the entire field is a null.

Thanks for the STRIP Subroutine. That will be very helpful in some other applications.

I wrote a routine to check for missing values
and have it working.
 
Posts: 43 | Location: San Jose, California. | Registered: July 18, 2005Report This Post
Master
posted Hide Post
USE DOUBLE BAR LIKE THIS
  
FIELDA = 'ABC'
FIELDB = 'DEF'
FIELDC = is missing a value
FIELDD = 'GHI'
NEW_FIELD = FIELDA || FIELDB || FIELDC || FIELDD ;




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders