Focal Point
Division

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9111015652

November 09, 2007, 12:01 PM
moyer1dl
Division
Hello

I am trying to do the following compute statement.

DEFINE
INTERVAL/I4 WITH POLICYNUMBER=IF INTERVAL LT 400 THEN INTERVAL + 1 ELSE 1;
CONFNUMB/I4 WITH POLICYNUMBER= IF INTERVAL EQ 400 THEN CONFNUMB + 1;
END

TABLE FILE LACAPP1
---
--
COMPUTE NEGPOS/A1 = IF ( ( CONFNUMB / 3 ) * 3 ) EQ CONFNUMB THEN 'P' ELSE 'N';
------


What it does determines if the number is evenly divisible if so it puts a P if not and N.

This used to work but now for some reason it says every confirmation number is a P.

CONFNUMB is an integer also.

Any Help

Dan


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
November 09, 2007, 12:37 PM
dwf
Only thing I can figure is that the division inside the compute no longer cares that the referenced field is integer. It must be doing a floating point compute. YOu could do this, I would think:

COMPUTE CONFNUMX/I4 = CONFNUMB / 3;
COMPUTE NEGPOS/A1 = IF (CONFNUMX * 3 ) EQ CONFNUMB THEN 'P' ELSE 'N';


dwf
November 09, 2007, 02:30 PM
moyer1dl
Thanks

That worked


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
November 10, 2007, 03:50 PM
Danny-SRL
Moyer,
You could also use the IMOD function:
COMPUTE NEGPOS/A1=IF IMOD(CONFNUMB,3,'I1') EQ 0 THEN 'P' ELSE 'N';



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF