format 0
cshelp 21131572; // DIALOG Create Price File
undeferr n
$portdft @master
$_settle y
DIALOG
ASCG_PORT
ACC %cutdate , ADDS_EDIT | ADDS_FILE_WRITE | ADDS_FILE_WARN_NID , , "Date of P&rice File" 10 8
ACC %date1 , ADDS_EDIT | ADDS_FILE_READ | ADDS_FILE_WARN_NID | ADDS_OPTIONAL | ADDS_NODEFAULT | ADDS_CAN_PRECEED, ,"&Date of Price File to copy (Optional)" 10 8
ACC $_settle , ADDS_CHECK | ADDS_YESNO, , "&Include settle date"
ASCG_OKCAN
ASCG_BROWSE
END
management
if #date1 @?!
endmonth #date1
endmonth #cutdate
undeferr y
lump
fxignore #cutdate
comma n
family #cutdate
settle n
load cli y*
load sec
list sum
load tran
next tran
next sec
if $_settle "y" =$
settle u
get * y*
load sec
list sum
load tran
next tran
next sec
settle n
next cli
#one 1
#numsec 0
#numpri 0
$prior x; will combine short and long positions
bfopen #cutdate n
load list
if #date1 @?!
split n
movsource y
pread 0 #date1
movsource n
load tran
if $:symb $prior =*
goto continue
$prior $:symb
if $:pricode "n" =*
goto continue
if $:ffx "y" =*
goto continue
#numsec #numsec 1+
bfrecord
bffield type $:ftype1
bffield symbol $:snmb1
undeferr n
if #:llpri0 @?!
#numpri #numpri 1+
bffield price #7:llpri0
else
bffield price #:miss
if #:source @?
bffield source #one
else
bffield source #:source
undeferr y
bfwrite
label continue
next tran
next list
fclose
okmsgbox
.Have created %1cutdate.pri with #numsec tickers and/or CUSIPS, #numpri of these were carried over prices.
if #numsec 0 =
. The price file %1cutdate.pri is empty because there are no positions held as of report date.
okmsgbox
end
trailer