Hi Karthik ,
When you call modify () then the data is pused to API layer and the data is re-read . This will wipe out the values of your Z fields as they are not present in the DB/API layer structures .
If the value of the Z attribute is initial at the time of sorting , it can only mean that the data has been refreshed after you filled the values. Check if there is any re-read happening after you set the values . Also add a built_table statement at the end of your do_prepare_output code .
Regards,
Vineet