You are on page 1of 1

set safety off

use subfac
zap
xx=getfile()
STRTOFILE(STRTRAN(FILETOSTR('&xx'), ' | 68', '68'), 'temp.txt')
*STRTOFILE(STRTRAN(FILETOSTR('temp.txt'), '
|
| | |', ''),
'temp.txt')
STRTOFILE(STRTRAN(FILETOSTR('temp.txt'), '| 001| ', ','), 'temp.txt')
STRTOFILE(STRTRAN(FILETOSTR('temp.txt'), '| ', ','), 'temp.txt')
STRTOFILE(STRTRAN(FILETOSTR('temp.txt'), '| ', ','), 'temp.txt')
STRTOFILE(STRTRAN(FILETOSTR('temp.txt'), '|', ''), 'temp.txt')
append from temp.txt type delimited for dirnr='68'
use subfac1
zap
append from subfac
erase temp.txt
**************************to fill exchange names as per their levels***********
use bpr-levels
tot=reccount()
rn=1
do while rn<tot+1
use bpr-levels
goto rn
x1=alltrim(exg_name)
x2=alltrim(tlevel)
use subfac1
replace all exg with '&x1' for exg=' '.and.dirnr='&x2'
rn=rn+1
enddo
use subfac1
copy to sublst type xls
**************************to count exchange dels****************************
use exglst
tot=reccount()
rn=1
do while rn<tot+1
use exglst
goto rn
x1=alltrim(exg_name)
use subfac1
count for exg='&x1' to y1
use exglst
goto rn
replace totdels with y1
rn=rn+1
enddo
copy to exgcnt type xls
***************************************************************************
*use swtdata
*copy to (rtrim(opfldr)+'&fl') type xl5
close all databases
quit

You might also like