Assuming content is z.csvreally needed, and not just an artifact of how you are currently implementing your program, you can use:
awk -F, '{ print $4 > "z.csv"
split($4, f, " ")
f4[f[1]] = 1
}
END { for (i in f4) print i }' x.CSV
split 4 , () f4 . , . , GNU awk ( awk ), awk sort.
GNU awk END :
END { asorti(f4); for (i in f4) print f4[i] }
z.csv, (a) , (b) print $4 > "z.csv".