Hi Jim, thanks for your help, I'm almost there just the last line of PPTalk code does not work for me!

define(&myAge,integer,0)
set(&myAge,strtoint(@(1,1,2)))
define(&myIndex,integer,0)

define(&PASbenefit,measure,0)
&PASbenefit := strtofloat(@(3,1,8))

define(&arrAge,arrayinteger,[50,51,52])
define(&arr1stYearVPUmale,arraystring,['63','67','71'])
define(&arr1stYearVPUFemale,arraystring,['39','42','44'])

define(&Value1,string,'0')
define(&i,integer,0)
define(&Gender,string,'0')

for(&i,0,1,2)
if(&arrAge[&i] = &myAge)
&myIndex := &i
endif()
endfor()

&Gender := @(2,1,1)

if(&Gender = 'M')
&Value1 := &arr1stYearVPUmale[&myIndex]
else
&Value1 := &arr1stYearVPUFemale[&myIndex]
endif()

&FirstYearVPU := &Value1

define(&myFloatVar,measure,0)
&myFloatVar := strtofloat(&FirstYearVPU)

define(&Value2,measure,0)
&Value2 := (&myFloatVar * &PASbenefit)

define(&TotalValue,measure,0)
&TotalValue := &Value2 /1000

%&TotalBenefit := strtofloat(&TotalValue)

Note: Global variable &TotalBenefit is assigned as string!
can you help.

THANKS






Edited by Sami786 (05/13/19 04:00 PM)
_________________________
Peace