sushmasriram
asked on
powerscript question
Below is my code. I am getting three C0031: syntax errors on lines 86,86 and 88. I am unable to figure out why. Please help.
integer row_count, li_downtime, i, ll_cnt
date ldt_begin_date, ldt_end_date, temp_date
string machine_num, setting
st_date_machine st_date_machine
open( w_calendar_range_response_ mach )
st_date_machine = message.powerobjectparm
If IsValid(Message.PowerObjec tParm) and Not IsNull(Message.PowerObject Parm) Then
If ClassName(Message.PowerObj ectParm) = 'st_date_machine' Then
st_date_machine = message.powerobjectparm
Else
MessageBox("Error","Return ed object is not valid")
Return -1
End If
Else
MessageBox("Error","Nothin g Returned")
Return -1
End If
ldt_begin_date = st_date_machine.st_begin_d ate
ldt_end_date = st_date_machine.st_end_dat e
machine_num = st_date_machine.st_machine _id
if machine_num <> '-1' then
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 1 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
tab_1.tabpage_1.dw_1.settr ansobject( sqlca )
tab_1.tabpage_1.dw_1.retri eve( ldt_begin_date, ldt_end_date, machine_num, row_count )
tab_1.tabpage_2.dw_2.settr ansobject( sqlca )
tab_1.tabpage_2.dw_2.retri eve( ldt_begin_date, ldt_end_date, machine_num, row_count )
else
end if
end if
Datastore ds_all
ds_all = Create Datastore
ds_all.DataObject = 'dw_all_machine' //the SQL for this DW is 'Select distinct machine_id from machine_downtime'
ds_all.SetTransObject(SQLC A)
if machine_num = '%' then
ll_Cnt = ds_all.Retrieve()
For i = 1 to ll_Cnt
machine_num = ds_all.Object.machine_id[i ]
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 10 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
tab_1.tabpage_1.dw_1.settr ansobject( sqlca )
tab_1.tabpage_1.dw_1.retri eve( ldt_begin_date, ldt_end_date, machine_num, row_count )
tab_1.tabpage_2.dw_2.settr ansobject( sqlca )
tab_1.tabpage_2.dw_2.retri eve( ldt_begin_date, ldt_end_date, machine_num, row_count )
else
end if
end if
integer row_count, li_downtime, i, ll_cnt
date ldt_begin_date, ldt_end_date, temp_date
string machine_num, setting
st_date_machine st_date_machine
open( w_calendar_range_response_
st_date_machine = message.powerobjectparm
If IsValid(Message.PowerObjec
If ClassName(Message.PowerObj
st_date_machine = message.powerobjectparm
Else
MessageBox("Error","Return
Return -1
End If
Else
MessageBox("Error","Nothin
Return -1
End If
ldt_begin_date = st_date_machine.st_begin_d
ldt_end_date = st_date_machine.st_end_dat
machine_num = st_date_machine.st_machine
if machine_num <> '-1' then
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 1 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
tab_1.tabpage_1.dw_1.settr
tab_1.tabpage_1.dw_1.retri
tab_1.tabpage_2.dw_2.settr
tab_1.tabpage_2.dw_2.retri
else
end if
end if
Datastore ds_all
ds_all = Create Datastore
ds_all.DataObject = 'dw_all_machine' //the SQL for this DW is 'Select distinct machine_id from machine_downtime'
ds_all.SetTransObject(SQLC
if machine_num = '%' then
ll_Cnt = ds_all.Retrieve()
For i = 1 to ll_Cnt
machine_num = ds_all.Object.machine_id[i
if ldt_begin_date > 1949-01-01 and ldt_end_date > 1949-01-01 then
temp_date = ldt_begin_date
do while temp_date <= ldt_end_date
select sum(downtime_minutes)
into :li_downtime
from machine_downtime
where ( machine_id = :machine_num ) and
( capture_date = :temp_date );
if li_downtime > 10 then
row_count++
end if
temp_date =relativedate(temp_date,1)
loop
tab_1.tabpage_1.dw_1.settr
tab_1.tabpage_1.dw_1.retri
tab_1.tabpage_2.dw_2.settr
tab_1.tabpage_2.dw_2.retri
else
end if
end if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
the code looks alrite to me...
do me a favour... can u debug thru the code and check if the code is entering the For loop and then the Do While Loop...
Also tell the value of ll_Cnt = ds_all.Retrieve()
Cheers,
Rosh
the code looks alrite to me...
do me a favour... can u debug thru the code and check if the code is entering the For loop and then the Do While Loop...
Also tell the value of ll_Cnt = ds_all.Retrieve()
Cheers,
Rosh
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER