DATA Step, Macro, Functions and more

Print only in PROC SEVERITY

Reply
Occasional Contributor
Posts: 9

Print only in PROC SEVERITY

 

Hello all,

 

I am using PROC SEVERITY to estimate different distributions that fit my data as such : 

 

proc severity data=&arg._ATTRI_APPREN_SEV print=allfitstats ;
   loss MNT_COUT_UNIT;
   dist _predefined_  ;
run;

My issue is that it prints everything in the Results viewer and I would just like the CDF, EDF & PDF estimation graphs and this table 

 

Capture.PNG

I looked at the procedure and found the table name, which is why I added the "allfitstats" print option BUT it still prints everything in the Results Viewer.

 

I then tried this :

 

ods graphics on;
ods select AllFitStatistics ;
proc severity data=&arg._ATTRI_APPREN_SEV ;
loss MNT_COUT_UNIT;
dist _predefined_ ;
run; 

But that just gives me an error :

 

Capture.PNG

 

Thanks in advance for the help.

Super User
Super User
Posts: 9,193

Re: Print only in PROC SEVERITY

Well you can do:

ods graphics on;
ods output AllFitStatistics=AllFitStatistics;
proc severity data=&arg._ATTRI_APPREN_SEV noprint;
  loss MNT_COUT_UNIT;
  dist _predefined_;
run; 
proc print data=AllFitStatistics;
run;

Change the proc print to only output what you want.

Occasional Contributor
Posts: 9

Re: Print only in PROC SEVERITY

[ Edited ]

Thanks for replying, just tried and it still gives me an error telling me the data doesn't exist

 

Capture.PNG

 

I'm guessing the problem comes from 'AllFitStatistics' but I'm sure that's the table name : 

 

Capture.PNG

Super User
Super User
Posts: 9,193

Re: Print only in PROC SEVERITY

It tells you in the Warning message - drop the noprint from my code, then it will create the dataset.  

You will likely need to clear the results viewer:

dm 'odsresults; clear';

 

Probably simpler to just create an output file rather than use the results viewer.

Occasional Contributor
Posts: 9

Re: Print only in PROC SEVERITY

It printed everything except the table I want in the Results Viewer, and I still have the same error  : 

 

Capture.PNG

 

How would I create an output file?

Super User
Super User
Posts: 9,193

Re: Print only in PROC SEVERITY

You create an output dataset like this:

ods graphics on;
ods output AllFitStatistics=AllFitStatistics;
proc severity data=&arg._ATTRI_APPREN_SEV;
  loss MNT_COUT_UNIT;
  dist _predefined_;
run; 
proc print data=AllFitStatistics;
run;

I don't have anything to test this with, but that should create a dataset.  Also you can try the out=options listed:
http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_severity_sect0...

There are examples under the examples tab.

Occasional Contributor
Posts: 9

Re: Print only in PROC SEVERITY

Tried this : 

 

ods graphics on;
proc severity data=&arg._ATTRI_APPREN_SEV /*outstat=AllFitStatistics*/;
  loss MNT_COUT_UNIT;
  dist _predefined_;
run; 
proc print data=AllFitStatistics;
run

With & without OUTSTAT and both print everything along with the table.

 

I think I'll just give up and let it as is. But the reason why I only want that specific table is because the full code is pretty long and I already have a lot in the Results View, all of which I need.

Ask a Question
Discussion stats
  • 6 replies
  • 83 views
  • 0 likes
  • 2 in conversation