Focal Point
DM Variable Maximum Numeric Value

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

February 21, 2008, 01:47 PM
mgrackin
DM Variable Maximum Numeric Value
Does anyone know what the maximum numeric value or length is for a Dialogue Manager variable? Does anyone know how to increase the maximum length?

I have a calculation for a DM variable that creates a number greater than 8 digits. I get the dreaded ******** in the variable.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
February 21, 2008, 02:20 PM
Francis Mariani
It looks like 8 numerals is the largest number in DM.

-SET &ECHO=ALL;

-SET &T1 = 99999999 + 1;
-TYPE &T1.LENGTH &T1

-SET &T1 = &T1 - 1;
-TYPE &T1.LENGTH &T1


I think you'll have to use TABLE FILE to do your match and then a -READ. The variable in the -READ can have a length greater than 9.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 21, 2008, 02:55 PM
mgrackin
Thanks for the confirmation, Francis. I have another idea to get around this which i will test.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
February 22, 2008, 09:48 AM
Jessica Bottone
This worked for us:

-SET &NEW_VALUE = FTOA(&ORIG_VALUE, '(D10c)', A13);

I recommend reading up on the FTOA subroutine to see if this will work for your situation.


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
February 22, 2008, 11:05 AM
mgrackin
Jessica,

That is interesting to know. I am familiar with the FTOA function. I ended up creating a DEFINE FUNCTION due to the fact that my calculation has a number of steps. The return value from the function is an A16 so the DM varialbe handles the value fine. In the FUNCTION I use the PTOA function to convert the final numeric value to Alpha.

This might not mean anything to you but hears the code I created.

DEFINE FUNCTION RMDYSCND (THEDATE/A8, BEGOREND/A1)
FOC_DAYS/P16=YMD(19001231,THEDATE);
INDSTIME/A1 =DSTIMEYN(FOC_DAYS);
SUB_DAYS/I5 =DECODE BEGOREND('B' 25203 'E' 25202 ELSE 0);
ADD_SCND/I5 =IF (INDSTIME EQ 'Y')
THEN DECODE BEGOREND('B' 14400 'E' 14399 ELSE 0)
ELSE DECODE BEGOREND('B' 18000 'E' 17999 ELSE 0);
FIN_SCND/P16=((FOC_DAYS - SUB_DAYS) * (60*60*24)) + ADD_SCND;
RMDYSCND/A16=PTOA(FIN_SCND,'(P16)','A16');
END


-SET &BEGSCNDS=RMDYSCND(&BEG_DATE,'B');
-SET &ENDSCNDS=RMDYSCND(&END_DATE,'E');

&BEG_DATE and &END_DATE are values from the input screen.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
February 22, 2008, 12:57 PM
Francis Mariani
Mickey,

Very interesting. I haven't used DEFINE FUNCTION for purely DM yet.

Thanks for sharing that.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 22, 2008, 01:43 PM
mgrackin
Francis,

This DEFINE FUNCTION capability in WF is great when you need to massage a data value supplied by a user. For example, our users enter a date range to select records. The problem is that the date/time values in the database are stored as the number of seconds from January 1, 1970 and are based on GMT instead of EST or DST time. Therefore I need to do a bunch of calculations to translate the dates entered by the user into values I can then plug into the WHERE clause. Doing this with a DM variable allows me to plug the raw values directly into the WHERE clause. This makes it possible for WF to build the SQL to pass to the database. If I called the DEFINE FUNCTION from a DEFINE field or from within the WHERE clause, the WHERE clause would not translate to SQL, forcing WF to pull all the records back and then process the selection, etc. etc.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
February 23, 2008, 01:54 PM
Danny-SRL
Mickey,
Remember that all numeric calculations in DM are integer. That is the reason for the ***. Also, you can input numbers with a decimal point and digits after the decimal point but in any calculations the results will be integer. When using FTOA, the result is alpha hence no problems.


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

February 25, 2008, 03:54 AM
Tony A
Danny,
quote:
calculations in DM are integer .... but in any calculations the results will be integer

On the version of WF that you are running that is not strictly true. Try this -

SET DMPRECISION = 7
-RUN
-SET &Pi = 3.1415927;
-SET &Radius = 4;
-SET &Circum = 2 * &Pi * &Radius;
-TYPE &Circum

T

This message has been edited. Last edited by: Tony A,



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