;-------------------------------------------------------------------------------
;
; Sample parsing control file for Sapphire Accounting -- see ACCOUNT.DOC
;
;-------------------------------------------------------------------------------
; COMMAND FORMATS                              EXAMPLES
; ---------------                              --------
; MINLEN  number                               MINLEN  "15"
; SET     var1 value1                          SET     NAME $FLINE[20 26]
; IGNORE  value1 value2                        IGNORE  PRICE "0.00"
; ACCEPT  value1 value2                        ACCEPT  $FLINE[1 3] "YES"
; IF      value1 value2 var1 value3 [value4]   IF      PRICE "0.00" BONUS "1.00"
; TRIM    var1 spec1 character                 TRIM    PRICE "R" "$"
; PAD     var1 spec1 character len             PAD     SERIALNUM "L" "0" "10"
; INSERT  var1 spec1 value1                    INSERT  PRICE "L" "$"
; CHANGE  var1 value1 value2                   CHANGE  DATE "/" "--"
; OUT     value1 value2 |output-picture        OUT     "X" "X" |{PRICE}
; OUTEND  value1 value2 |output-picture        OUTEND  "X" "X" |{$FLINE}
;-------------------------------------------------------------------------------


;      Accept Summary records only

ACCEPT $FLINE[  1   1] = "S"

;      Ignore activity by the sysop and guest accounts

IGNORE $FLINE[ 24  28] = "SYSOP"
IGNORE $FLINE[ 24  28] = "GUEST"


;      Set variables

SET    RealName = $FLINE[  3  22]
SET    UserName = $FLINE[ 24  43]
SET    Level    = $FLINE[ 45  45]
SET    Calls    = $FLINE[ 47  51]
SET    SOCDate  = $FLINE[ 66  73]
SET    SOCTime  = $FLINE[ 75  82]
SET    SOCDay   = $FLINE[ 95  95]
SET    EOCDate  = $FLINE[ 99 106]
SET    EOCTime  = $FLINE[108 115]
SET    EOCDay   = $FLINE[128 128]
SET    SessDnld = $FLINE[131 135]
SET    SessUpld = $FLINE[165 169]
SET    SessPost = $FLINE[201 205]


;      Trim variables

TRIM   RealName   "B" " "
TRIM   UserName   "B" " "
TRIM   Level      "B" " "
TRIM   Calls      "B" " "
TRIM   SOCDate    "B" " "
TRIM   SOCTime    "B" " "
TRIM   SOCDay     "B" " "
TRIM   EOCDate    "B" " "
TRIM   EOCTime    "B" " "
TRIM   EOCDay     "B" " "
TRIM   SessDnld   "B" " "
TRIM   SessUpld   "B" " "
TRIM   SessPost   "B" " "

;      Interpret day-of-week

CHANGE SOCDay     "0" "SUN"
CHANGE SOCDay     "1" "MON"
CHANGE SOCDay     "2" "TUE"
CHANGE SOCDay     "3" "WED"
CHANGE SOCDay     "4" "THU"
CHANGE SOCDay     "5" "FRI"
CHANGE SOCDay     "6" "SAT"

CHANGE EOCDay     "0" "SUN"
CHANGE EOCDay     "1" "MON"
CHANGE EOCDay     "2" "TUE"
CHANGE EOCDay     "3" "WED"
CHANGE EOCDay     "4" "THU"
CHANGE EOCDay     "5" "FRI"
CHANGE EOCDay     "6" "SAT"


;      Output

OUT    "X" = "X"  |"{RealName}","{UserName}",{Level},{Calls},
OUT    "X" = "X"  |"{SOCDate}","{SOCTime}","{SOCDay}",
OUT    "X" = "X"  |"{EOCDate}","{EOCTime}","{EOCDay}",
OUTEND "X" = "X"  |{SessDnld},{SessUpld},{SessPost}
