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     only return records where character length is 1

Read-Only Read-Only Topic
Go
Search
Notify
Tools
only return records where character length is 1
 Login/Join
 
Silver Member
posted
Hi Smiler Does anyone know how to specify in the WHERE statement of a TABLE FILE to only return those records where the value's character length is only 1? For example, I only want to see the records where the data has 'A' or 'B' but not 'A1' or 'B1' or 'C1'.
Thanks for your help!


WebFOCUS 7.6.10, Windows Vista, Oracle, Output-Excel/PDF/HTML
 
Posts: 39 | Registered: September 20, 2007Report This Post
Virtuoso
posted Hide Post
There is a function call ARGLEN that tests the length of a character string (not including trailing spaces.) Create a defined field using that function and then create your WHERE statement based on the defined field. Be aware that this criteria cannot be passed to the DBMS so it may be somewhat inefficient, but I can't think of another way to do it.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Guru
posted Hide Post
WHERE ARGLEN(fieldlength, field, 'I4') EQ 1


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Virtuoso
posted Hide Post
I guess you could also use EDIT to mask off the first character in a defined field and then test to see if your masked field is equal to the full field. However, this would not be any more efficient than ARGLEN and less straightforward.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Guru
posted Hide Post
Think about the following

WHERE MYFIELD IS '$'

This should select data where MYFIELD is fixed length field, anything appears in the first position, and the balance of the field is blank.

ref: wf713crlang.pdf p5-29

HTH


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Silver Member
posted Hide Post
Thank you all for your assistance! ARGLEN worked. It gave me the exact result I was looking for!
Have a great day


WebFOCUS 7.6.10, Windows Vista, Oracle, Output-Excel/PDF/HTML
 
Posts: 39 | Registered: September 20, 2007Report This Post
Virtuoso
posted Hide Post
All blanks would be length zero, not one -- so if you use
WHERE MYFIELD IS '$'

you should add
AND MYFIELD NE ' '

My guess is expressing the first as

WHERE MYFIELD EQ EDIT(MYFIELD,'9');

(or an equivalent expression using SUBSTR)
increases the likelihood that it will be passed through.


- 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     only return records where character length is 1

Copyright © 1996-2020 Information Builders