Additional case statement code in generation of poll files. 

CASE WHEN DEPARTMENT=115 THEN 'CON                 ' ELSE '4r4                 ' END AS COMMENT_CD
,CASE WHEN I.IDEPT=950 AND ISDEPT=24 THEN '115' ELSE RIGHT(CONCAT('000',IFNULL(IDEPT,0)),3) END AS DEPARTMENT