IF !USED('tab_a')
USE tab_a ALIAS tab_a IN 0
ENDIF
_S = 4 &&从第4列开始统计
_E = 9 &&统计到第9列结束
SELECT tab_a
_F = AFIELDS(_FArr,'tab_a') &&将字段信息存入数组_FArr
SCAN
_C = '' &&用于存储每行字符
FOR ii = _S TO _E &&从第4列开始统计
_C = _C + ALLTRIM(&_FArr[ii,1])
ENDFOR
REPLACE ALL 病假 WITH ALLTRIM(STR(OCCURS('病',_C))),事假 WITH ALLTRIM(STR(OCCURS('事',_C))),旷工 WITH ALLTRIM(STR(OCCURS('旷',_C))),探亲 WITH ALLTRIM(STR(OCCURS('探',_C)))
ENDSCAN