This is my first attempt at data _null_ reports with ODS, and I'm just learning how things work.
I'm creating a report to show project information from a questionnaire. One item is project description with can be very long. I'm starting with a dataset with one client per row. I created a tall report dataset with three reporting columns. I'd like to end up with a separate page for each client. So I have a by-group data step. I am not sure what to use for the put statement in the last.client condition. _BLANKPAGE_ seems to not be right for ODS. It inserts a great many blank lines following the value. What is the right way to do this?
Thanks
data report ;
keep client var label text;
set survey;
by descending client notsorted;
length var $10 label $25 text $3000;
array vars client email campaddr q2_6: q3_2;
where q9_1=1;
do i = 1 to dim(vars);
var = vname(vars{i});
label = vlabel(vars{i});
text = vars{i};
output;
end;
run;
*proc print data=one;
run;
data _null_;
set report;
by client var notsorted;
file print ods=(variables=(label text)) ;
put _ods_;
if last.client then put _BLANKPAGE_;
run;
Errm, why not just get your data, then use ods <destination> and use proc report, then you can simply do page breaks and all the normal formatting methods. Not sure what creating a plain text file from a datastep is going to get you, you certainly won't get most of the formatting. If your exporting the data for transfer, then CSV or XML, for reports RTF or PDF.
As an old co-worker used to say, you touched me right there.
That was one of those cases of getting stuck in plan A. My original attempt was to do it all in one data step. Then once I figured out that I should make a report dataset I was stuck in Data _Null_mode. Sorry for a silly one.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.