


PROCEDURE makqcu_phase_4, makqcu4 (
qcu: name = $required
delivery_medium, dm: boolean
status )


crev ignore k=status
crev qi k=string v=$string($value(qcu))
crev work k=string
crev wev$working_catalog k=string s=xref
crev qev$psr k=string s=xref
crev qev$qcu_base k=string s=xref
crev count1
crev count2
crev blank k=string v=' '
crev comma k=string v=','
crev msg k=string

crev temp1 k=string v=$unique//'.$asis'
crev psr_path k=string v=':CSERV.ARHOPS.'//$translate(ltu,qev$psr)
crev save_cp  k=string v=':DSB.SERVICE.'//$translate(ltu,qev$psr)
crev cp_path k=string v='.'//$job(user)//'.'//$strrep(qi)//'_DF'
crev hi_path k=string v=':CSERV.ARHOPS.HISTORY.$EOI'
crev ds_path k=string v=':DSB.SERVICE.HISTORY'
crev temp2 k=string v=$unique

crerv DSB 'LOGIN SERVICE CENTER DSB'

copf $fname(ds_path) $fname(temp2)

detf $fname(hi_path) status=ignore

putl ' Moving QCU Corrections from'
putl '        '//cp_path
putl '               To'
putl '   '//save_cp
putl '               And'
putl '    '//psr_path

copf $fname(psr_path) $fname(save_cp)



disce $fname(psr_path) do=c o=$fname(temp1)
rewf $fname(temp1) status=ignore

FOR i = 1 TO 3 DO
accl v=work i=$fname(temp1)
FOREND

msg = $substr(work,13,8)

    count1 = $scan_not_any(blank,msg)
    work = $substr(msg,count1,$strlen(msg))
    msg = $trim(work)


work = ' '
FOR i = 1 TO $strlen(msg) DO
  IF $substr(msg,i,1) <> ',' THEN
    work = work//$substr(msg,i,1)
  IFEND
FOREND

count2 = $integer(work)
count1 = count2/7200

work = '  '//$translate(ltu,qev$psr)//'        '//$strrep(qi)//'          '
work = work//$translate(ltu,qev$qcu_base)//'          '//msg//'         '
work = work//$strrep(count1)//' Minutes'

putl work o=$fname(hi_path//'.$EOI')
putl work o=$fname(temp2//'.$EOI')

rewf $fname(temp2) status=ignore
copf $fname(temp2) $fname(ds_path)

putl ''
putl ' Completed electronic packaging'
putl ''

delrv DSB

only_electronic =  $value(delivery_medium)
IF NOT only_electronic THEN
  makqcu5,$value(qcu)
ELSE
IFEND

PROCEND makqcu_phase_4

