Hi everyone ... Right, I have managed to get the output that I require by inserting the piece of Cynthia's code as a start and end point (editing the code of the summary table) - see below.... This works and creates a .csv file for every instance of PROCODED and names the .csv files PROCODED1, PROCODE2, PROCODE3 etc which sort of solves the issue but what would be perfect would be if the filenames were the actual name of the PROCODED - IE 5PV.csv and 5NH.csv depending on the PROCODED from the table. Is there a way in which to have the filename on the ODS dynamic to the table from which it is writing...? Thanks Steve ods _all_ close; ods csvall file="\\IC.Green.Net\IC_User_DFS\PDrive\SHudsoo\S Hudson Documents\Test\PROCODED.csv" newfile=TABLE; PROC TABULATE DATA=WORK.QUERY_FOR_SHDQ_APC_DUPL_TBL_0000 OUT=WORK.STABSummaryTablesQUERY_FOR_SHDQ_(LABEL="Summary Tables for WORK.QUERY_FOR_SHDQ_APC_DUPL_TBL_0000") ; VAR Calculation; CLASS EPISODE_END_GROUP / ORDER=UNFORMATTED MISSING; CLASS SUBDATE / ORDER=UNFORMATTED MISSING; CLASS PROCODED / ORDER=UNFORMATTED MISSING; TABLE /* Page Dimension */ PROCODED, /* Row Dimension */ SUBDATE* N ALL={LABEL='Total (ALL)'}* N, /* Column Dimension */ EPISODE_END_GROUP ALL={LABEL='Total (ALL)'} ; ; RUN; ods _all_ close; /* ------------------------------------------------------------------- End of task code. ------------------------------------------------------------------- */ RUN; QUIT; TITLE; FOOTNOTE;
... View more