Code:
function pdsnrater()
{
awk -F"|" '
function ceil(val) { return (val == int(val)) ? val : int(val)+1}
{
if ($5 == "MB")
printf("%s,%s,%s,%s,%s,%d,%s,%s,%s,%s,%s,%s,%d,%s,%s,%s\n",$1,$2,$3,$4,$6,ceil(($10+$11)/1024/1024),$8,$9,$10,$11,$12,$13,$14,$15,$16,$5)
else
printf("%s,%s,%s,%s,%s,%d,%s,%s,%s,%s,%s,%s,%d,%s,%s,%s\n", $1,$2,$3,$4,$6,ceil(($10+$11)/1024/10),$8,$9,$10,$11,$12,$13,$14,$15,$16,$5)
} ' FS="|" OFS="|" $1 > $1.tmp
mv $1.tmp $1
}