Dear all:
I just joined the community and I hope to learn and share with you as much as possible.
I have one question to start:
I need to create as many reports as categories are in the BY statement of a PROC FREQ (there will be around 30), and export the PDF output as an individual PDF file (this is, one PDF file for each category in the BY statement).
So far, I've come to this syntax, which exports only an aggregated file instead of for each category in the BY statement:
ODS PDF STYLE=Styles.SASweb FILE='C:\S1_out.pdf';
PROC FREQ DATA=WORK.Labels_Export_CMS;
TITLE "Finalized Cases";
TABLES
IntervierName*DispositionCode / nocol nopercent;
WHERE status=2;
BY Supervisor;
RUN;
ODS PDF CLOSE;
Ideally, I would need to do this as efficient as possible (hopefully, not making one syntax as the one above for each of the 30 cases), since I'll need to generate this information from the same database (same structure, new information), weekly.
Thank you very much.
Rafa
Try the newfile=bygroup option in the ODS PDF statement. I don't know if theres's a way to control the filename though.
proc sort data=sashelp.class out=class;
by sex;
run;
ods pdf file="C:\_LocalData\Summary.pdf" style=seaside newfile=bygroup;
proc freq data=class;
by sex;
table age;
run;
ods pdf close;
Try the newfile=bygroup option in the ODS PDF statement. I don't know if theres's a way to control the filename though.
proc sort data=sashelp.class out=class;
by sex;
run;
ods pdf file="C:\_LocalData\Summary.pdf" style=seaside newfile=bygroup;
proc freq data=class;
by sex;
table age;
run;
ods pdf close;
Thank you very much! This works just fine for what I need to do.
I can work around a way to solve the name issue (since it is sorted, I could link the variable name given by the newfile=bygroup statement with the actual value in a separate table). If I find a SAS solution to it, I'll post it here as well.
:smileygrin:
Hi, when you use NEWFILE=, the names are always numbered versions of the original FILE= value. You can't control the names, unless you "macro-ize" your code to supply a specific name.
cynthia
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: