Hi Knob,
Version 4.8
I have been trying other system settings etc to bypass this error, but it seems to be consistent within that dialing group. I will post the code for one entry in that group (they are all basically the same):
;ABC.WAS
;Script for Downloading data from ABC Company
;
string st_date, end_date, sts_date
string savename, repname, acctname
integer foundrep, numex, serv_reps, sales_reps, rep_no
integer dtype=1
string comp="ABC"
#include "datesa.inc"
#include "captset.inc"
#include "adpfunc.inc"
#include "gen_func.inc"
proc main
string reps[15], saves[15], acct[15]
string name, pass
integer tot_rep
call set_capt ; set capture defaults
call set_date with &st_date, &end_date, &sts_date
serv_reps = 3
sales_reps = 2
reps[1] = "REPORT 1"
reps[2] = "REPORT 2"
reps[3] = "REPORT 3"
reps[4] = "REPORT 4"
reps[5] = "REPORT 5"
reps[6] = ""
reps[7] = ""
reps[8] = ""
reps[9] = ""
reps[10] = ""
reps[11] = ""
reps[12] = ""
reps[13] = ""
saves[1] = "REPORT1.DMP"
saves[2] = "REPORT2.DMP"
saves[3] = "REPORT3.DMP"
saves[4] = "REPORT4.DMP"
saves[5] = "REPORT5.DMP"
saves[6] = ""
saves[7] = ""
saves[8] = ""
saves[9] = ""
saves[10] = ""
saves[11] = ""
saves[12] = ""
saves[13] = ""
acct[1] = "ABC-S"
acct[2] = "ABC-S"
acct[3] = "ABC-S"
acct[4] = "ABC-S"
acct[5] = "ABC-FI"
acct[6] = ""
acct[7] = ""
acct[8] = ""
acct[9] = ""
acct[10] = ""
acct[11] = ""
acct[12] = ""
acct[13] = ""
name = "abc123"
pass = "xyz987"
;login
call login with name, pass
; reports
rep_no=0
tot_rep=serv_reps+sales_reps
while rep_no < tot_rep
rep_no=rep_no+1
repname=reps[rep_no]
savename=saves[rep_no]
acctname=acct[rep_no]
call scanrep
endwhile
;exit
pause 2
transmit "^[OR" ;F3
waitfor "Function"
transmit "^[OR" ;F3
pause 2
disconnect
endproc
;
; Dates.inc
; This is where to set the dates for extraction
;
proc set_date
param string st_date, end_date, sts_date
string Fname="datesA.txt"
string lineinfo
if fopen 0 Fname READ
fread 0 lineinfo 255
substr st_date lineinfo 0 7
substr end_date lineinfo 8 7
substr sts_date lineinfo 16 7
fclose 0
else
errormsg "Can't open for input." Fname
endif
endproc
;
; captset.inc
; Capture settings for download
;
proc set_capt
set capture path "c:\download"
set capture overwrite ON
set capture recordmode FILTERED
set capture autostart off
capture off
endproc
; General Type Functions
;
; Enters is for sending a specified number of enter's
;
proc enters
param integer times
integer i
for i = 1 upto times
transmit "^M"
endfor
endproc
proc movedown
param integer times
integer i
for i = 1 upto times
transmit "^[[B"
endfor
endproc
proc moveup
param integer times
integer i
for i = 1 upto times
transmit "^[[A"
endfor
endproc
proc moveleft
param integer times
integer i
for i = 1 upto times
transmit "^[[D"
endfor
endproc
proc moveright
param integer times
integer i
for i = 1 upto times
transmit "^[[C"
endfor
endproc
proc errorrep
param string report
string errorlog="c:\download\errorlog.txt"
string errdate, errtime
fopen 1 errorlog APPEND TEXT
if success
errdate=$DATE
errtime=$TIME
fputs 1 ""
fstrfmt 1 "Error on report - %s - %s at %s %s" comp, report, errdate, errtime
endif
fclose 1
disconnect
clear
halt
endproc
proc errorlog
string errorlog="c:\download\errorlog.txt"
string errdate, errtime
fopen 1 errorlog APPEND TEXT
if success
errdate=$DATE
errtime=$TIME
fputs 1 ""
fstrfmt 1 "Error logging in for %s at %s %s" comp, errdate, errtime
endif
fclose 1
disconnect
clear
halt
endproc
; Functions to be used for XYZ Dealers
;
; scanrep is to look for the report to run
;
proc scanrep
string checkname
integer pass=0
pause 2
call moveup with 1
transmit acctname
call enters with 1
pause 1
transmit "RPG"
call enters with 1
pause 2
transmit "^[OR" ;F3
foundrep=0
numex=0
waitfor "<EXIT>"
if failure
call errorrep with repname
endif
pause 3
call movedown with 1
rget checkname 36
PAUSE 5
while 1
if foundrep
exitwhile
endif
if numex
call enters with 1
exitwhile
endif
call movedown with 2
call moveup with 1
rget checkname 36
PAUSE 1
if strfind checkname repname
call moveup with 1
call runrep
endif
if strfind checkname "<EXIT>"
call foundex
endif
endwhile
endproc
;
; runrep runs the report
;
proc runrep
string start_d
if rep_no<=serv_reps
start_d=st_date
else
start_d=sts_date
endif
call enters with 1
waitfor "OPIES"
if failure
call errorrep with repname
endif
pause 3
transmit "R"
call enters with 1
set capture file savename
waitfor "Terminal"
if failure
call errorrep with repname
endif
transmit "1"
call enters with 1
capture on
if rep_no!=3
waitfor "GREATER"
if failure
call errorrep with repname
endif
transmit start_d
call enters with 1
endif
if rep_no!=3
waitfor "LESS THAN"
if failure
call errorrep with repname
endif
transmit end_date
call enters with 1
endif
when TARGET 0 "Key any key to continue: " call runrep2
when QUIET 300 call stalled
while $CARRIER ; Loop while connected.
yield ; Release ASPECT process time
if foundrep
exitwhile
endif
endwhile
endproc
; waitfor "Key any key to continue: " 7200
; check for error report
; if failure
; call errorrep with repname
; endif
proc stalled
call errorrep with repname
when clear
endproc
proc runrep2
capture off
call enters with 1
waitfor "OPIES"
if failure
call errorrep with repname
endif
transmit "E"
call enters with 1
pause 1
call enters with 1
foundrep = 1
when clear
endproc
;
; foundex increments the numex when exit is found
;
proc foundex
numex=numex+1
endproc
proc login
param string name, pass
switch dtype ; Find value of numeric variable
case 0 ; and display corresponding
call enters with 1
waitfor "login:"
transmit name
call enters with 1
endcase
case 1
call enters with 1
waitfor "ACCOUNT NAME:"
transmit name
call enters with 1
endcase
endswitch
waitfor "Password:"
if failure
call errorlog
endif
transmit pass
call enters with 1
waitfor "Press any key to continue." 15
if success
call enters with 1
endif
; check for error logging in
waitfor "login:" 10
if success
call errorlog
endif
endproc