If I understand correctly you are missing the part that writes the obs from HAVE to the new file. I comments the line HEADER=1; and added put (_ALL_)(:);
proc sql noprint;
select quote(strip(name)),varnum into :header3 separated by " ',' ", :dummy
from dictionary.columns
where (memname = 'HAVE' and libname = 'WORK')
order varnum;
quit;
%put NOTE: &=header3;
%let header1 = %str(7,0,,,,,Data Needed ,,,New Submission data,,,,,,,,,);
%let header2 = %str(Status,,,,,Data Needed ,,,,,New Submission data,,,,,,,,,);
%put &header1;
%put &header2;
Data _Null_;
Set have ;
FILE "./Have.csv" dsd;
IF _N_ EQ 1 THEN DO;
PUT "&Header1";
PUT "&Header2";
put &header3;
*HEADEROUT = 1;
END;
put (_all_)(:);
RUN;
... View more