I'm using the NOPRINT option as I don't want much in the way of output in my production code.
But I do want the hazard ratios output as a dataset from PROC PHREG. But when I set the NOPRINT option ODS doesn't create the dataset. Without the NOPRINT option I get a humungous amount of information, that neither I nor the client wants.
Is there a way to output the HRs to a dataset without using ODS?
Thank!
You can control the output with ODS SELECT/EXCLUDE. Remove NOPRINT and add an ODS SELECT for the the table of interest.
http://sasnrd.com/sas-ods-trace-select-exclude/
@jones1901 wrote:
I'm using the NOPRINT option as I don't want much in the way of output in my production code.
But I do want the hazard ratios output as a dataset from PROC PHREG. But when I set the NOPRINT option ODS doesn't create the dataset. Without the NOPRINT option I get a humungous amount of information, that neither I nor the client wants.
Is there a way to output the HRs to a dataset without using ODS?
Thank!
The command
ODS _ALL_ close;
closes all ods destinations. Reopen them later with
ODS listing;
or
ODS HTML;
etc.
Thanks guys,
But these restrict the ODS output. I don't mind how many datasets are shot out of PHREG with the ODS.
I'm using the NOPRINT option because it stops stuff going to the output destination. The downside of NOPRINT is that no ODS datasets can be produced (or at least, that's my understanding).
But I like the lateral approach to the issue. It's made me think... running SAS in batch, is it possible to use, say, PROC PRINTTO, to interrupt the program output's usual destination, then I run PHREG with the full nine yards of output going to a different (dummy) destination and enabling me to pick up the hazard ratios, and then switch back so that the output continues to run to its usual destination? I've tried a few ways, but I can't see a way of doing it.
Much obliged to you for your ideas!
ODS SELECT/EXCLUDE controls the output written to the HTML/Listing destination, it doesn't affect anything from an OUT=statement.
ODS SELECT HAZARDRATIOS;
ODS output hazardratios=mydata;
proc phreg.....
.....
run;
ods select all;
I'm fairly certain that's what you're looking for here.
Oh, OK, that sounds the business, then.
I'll give that a go when I'm back at the desk.
Nice one. Ta.
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!ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.