script to create output files for SDSS