I have a DI studio job, the final step of which uses the 'File Write' task to output the final data set to an external .csv file. This works fine. However, what I would like to do is insert some text into the file should there be no data in the output, rather than ujust supply the user with an empty file, e.g. 'There was no data to display'.
Can anyone suggest how this could be done?
Below is the code generated by the task:
data _null_;
set &SYSLAST;
attrib FIN_YEAR length = 8;
attrib DDV_C_MONTH length = 8
format = DATE7.;
attrib DDV_C_MON length = $1;
attrib DDV_C_CAT1_DRVS_HRS_COMBI length = 8;
attrib DDV_TOTAL_TARGET length = 8;
quote='"';
file '/home/sasdev/sas_files/test/test2.csv' dlm=',';
put
quote +(-1) FIN_YEAR +(-1) quote
quote +(-1) DDV_C_MONTH +(-1) quote
quote +(-1) DDV_C_MON +(-1) quote
quote +(-1) DDV_C_CAT1_DRVS_HRS_COMBI +(-1) quote
quote +(-1) DDV_TOTAL_TARGET +(-1) quote
;
run;
%rcSet(&syserr);