Hi,

       I need to write to different csv files based on a column data. So I need to check the column data before writing to file.

Here is the code to write the data to file.

while (ind '= ""){
set row = ^CacheTemp(repid,"MAIN",ind)
use filemain write row,!
; Get next row index for MAIN report
set ind $order(^CacheTemp(repid,"MAIN",ind))
} close filemain
}

Thanks

Jude