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]Can I use the 99.99999 to identify a decimal place?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Can I use the 99.99999 to identify a decimal place?
 Login/Join
 
Platinum Member
posted
I have a report that runs against a flatfile and only generates data if it finds an error. This is a report we actually want to come back empty.

Right now it just checks the field F11 to make sure it is not equal to 0.

WHERE (ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F2 IS-NOT MISSING )  
OR  (ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F4 NE '0')  
OR  (ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F7 IS-NOT MISSING )  
OR  (NOT ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F8 IN ('A'))  
OR  (ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F11 EQ 0) 
OR  (ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F12 IS-NOT MISSING )


Now I need to check it to make sure the last 5 digits are all zero's. This is payroll data and the system the flatfile is imported to only does time in 1/10th of an hour (6, 12, 18, 24, 30, etc) shown in the flat file in decimal 10ths as .1 .2 .3 .4 etc.

In this example:

"REG","10.250000","","0"""
 "REG","10.500000","","0","""


Line one would be in the report as it is not a tenth, but line 2 would pass.

So I need another OR statement for F11 that will make sure
XX.X99999 that the 9 decimal places are equal to Zero.

Am I even barking up the right tree?

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


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Expert
posted Hide Post
Whats the format of the field ?

You could right justify the field, then pull the last 5 characters to check that they are all zeros.


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
They are all Alpha since the reports runs against a flat file.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Expert
posted Hide Post
Or EDIT([thefield]) and check for the specific characters in the resultant string...
IF F11 EQ '00.000000' THEN 'This' ELSE 'That' ;
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
Perhaps there is a way to SUM the value of that field to make sure it is divisible by 10? and therefore correct? .1 .2 .3 .4 etc.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Expert
posted Hide Post
Change it to numeric and do the math?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
Right Justify and pull the last 5 chars.

EX -LINES 7 EDAPUT MASTER,TST_DATA,CV,FILE
FILENAME=TST_DATA, SUFFIX=COM,$
SEGNAME=TST_DATA, $
  FIELD=FIELD1 ,ALIAS=  ,A20 ,A20 ,$
  FIELD=FIELD2 ,ALIAS=  ,A20 ,A20 ,$
  FIELD=FIELD3 ,ALIAS=  ,A20 ,A20 ,$
  FIELD=FIELD4 ,ALIAS=  ,A20 ,A20 ,$

FILEDEF TST_DATA DISK tst_data.ftm (RECFM V
SET PCOMMA=ON

EX -LINES 3 EDAPUT FOCTEMP,TST_DATA,CV,FILE
"REG","10.250000","","0"
"REG","10.500000","","0"

-RUN

TABLE FILE TST_DATA
PRINT *
WHERE EDIT(RJUST(20,FIELD2,'A20'),'$$$$$$$$$$$$$$$99999') NE '00000'
END


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
Since my F11 field is A255V, will I need 250 $ dollar signs for the RJUST statement.

Like this:

 WHERE EDIT(RJUST(255,FIELD11,'A255V'),'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$99999') NE '00000' 


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Platinum Member
posted Hide Post
You could reverse the string and then it would be the first 5 chars you need

EDIT(REVERSE(255,RJUST(255,TXT,'A255'),'A255'),'99999');


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Expert
posted Hide Post
Or you could use 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
Platinum Member
posted Hide Post
quote:
Originally posted by Waz:
Or you could use SUBSTR.


This turned out to be the solution.

DEFINE DECIMAL_STRING_6/A6= GETTOK(F11X, 10, 2, '.', 6, DECIMAL_STRING);

THis count the 6 spaces to the right of the decimal and made sue the last 5 were all Zero's.


prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL

 
Posts: 133 | Location: Orlando, FL | Registered: August 04, 2005Report This Post
Virtuoso
posted Hide Post
Function CHKFMT might be another option:

F11_CHECK/I1 = CHKFMT(10,F11,'99.900000','I1');

F11_CHECK will be zero if the value in F11 fits the mask, otherwise it contains the position of the first character failing the mask.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 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     [SOLVED]Can I use the 99.99999 to identify a decimal place?

Copyright © 1996-2020 Information Builders