Sandy Blondino
17th October 2013, 18:42
Hello,
I'm having trouble getting a 3GL script to compile.
I have a session with 4GL script that calls the 3GL script and that works fine.
I'm trying to check for records in several tables by calling different functions, but I get compile errors from the functions. 'tcpdno' not expected and 'Missing RETURN(...) in function 'verify.prod.order'.
Here is a code snippet.
Am I missing something or is this not possible in a 3GL?
Thanks,
Sandy
|* Script Type: 123
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
extern domain tcbool stop.process
function main()
{
stop.process = false
while true
check.for.new.records()
suspend(10000) |10000 miliseconds = 10 seconds
if stop.process then
break
endif
endwhile
}
function check.for.new.records()
{
long count
domain tcpdno temp.pdno
domain tcopno temp.opno
domain tiqep3 temp.qcmp
domain tiqep3 temp.qrjc
domain tcmcs.long temp.rkey
table ttilit601 | Report Operations Completed Integration
table ttisfc010 | Production Planning by Order
table ttisfc001 | Production Orders
select tilit601.*
from tilit601
where tilit601.step <> 99
order by tilit601._index1
selectdo
temp.rkey = tilit601.rkey
temp.pdno = tilit601.pdno
temp.opno = tilit601.opno
temp.qcmp = tilit601.qcmp
temp.qrjc = tilit601.qrjc
|verify that production order exists
if verify.prod.order(temp.pdno) then
|check production order status
if verify.prod.status(temp.pdno) then
....
endif
endif
endselect
}
domain tcpdno t.pdno
domain tcopno t.opno
function long verify.prod.order(ref tcpdno t.pdno)
{
select tisfc001.*
from tisfc001
where tisfc001._index1 = {:t.pdno}
selectempty |production order does not exist
db.retry.point()
select tilit601.*
from tilit601 for update
where tilit601._index2 = {:t.pdno}
selectdo
tilit601.step = 99
tilit601.emsg = "Production Order does not exist"
db.update(ttilit601, db.retry)
commit.transaction()
endselect
return(0)
selectdo
return(1)
endselect
}
I'm having trouble getting a 3GL script to compile.
I have a session with 4GL script that calls the 3GL script and that works fine.
I'm trying to check for records in several tables by calling different functions, but I get compile errors from the functions. 'tcpdno' not expected and 'Missing RETURN(...) in function 'verify.prod.order'.
Here is a code snippet.
Am I missing something or is this not possible in a 3GL?
Thanks,
Sandy
|* Script Type: 123
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
extern domain tcbool stop.process
function main()
{
stop.process = false
while true
check.for.new.records()
suspend(10000) |10000 miliseconds = 10 seconds
if stop.process then
break
endif
endwhile
}
function check.for.new.records()
{
long count
domain tcpdno temp.pdno
domain tcopno temp.opno
domain tiqep3 temp.qcmp
domain tiqep3 temp.qrjc
domain tcmcs.long temp.rkey
table ttilit601 | Report Operations Completed Integration
table ttisfc010 | Production Planning by Order
table ttisfc001 | Production Orders
select tilit601.*
from tilit601
where tilit601.step <> 99
order by tilit601._index1
selectdo
temp.rkey = tilit601.rkey
temp.pdno = tilit601.pdno
temp.opno = tilit601.opno
temp.qcmp = tilit601.qcmp
temp.qrjc = tilit601.qrjc
|verify that production order exists
if verify.prod.order(temp.pdno) then
|check production order status
if verify.prod.status(temp.pdno) then
....
endif
endif
endselect
}
domain tcpdno t.pdno
domain tcopno t.opno
function long verify.prod.order(ref tcpdno t.pdno)
{
select tisfc001.*
from tisfc001
where tisfc001._index1 = {:t.pdno}
selectempty |production order does not exist
db.retry.point()
select tilit601.*
from tilit601 for update
where tilit601._index2 = {:t.pdno}
selectdo
tilit601.step = 99
tilit601.emsg = "Production Order does not exist"
db.update(ttilit601, db.retry)
commit.transaction()
endselect
return(0)
selectdo
return(1)
endselect
}