You must use another PROC PRINTTO to close the file referenced by fileref
ROUTED so that the following DATA step can read it. The step also routes subsequent
procedure output to the default destination. PRINT= causes the step to affect
only procedure output, not the SAS log.
proc printto print=print;