Desktop productivity for business analysts and programmers

Formats of ODS Table

Reply
Contributor
Posts: 70

Formats of ODS Table

I was trying to change the format of the ODS Table (ParameterEstimates) of HPGenselect but no success.

I tried using Proc Tabulate but nothing works.

 

I tried this.

 

proc template;
edit HPSTAT.HPGenselect.ParameterEstimates ;
edit Estimate; format=Best32.; end;
edit StdErr; format=Best32.; end;
edit Effect ; format = $200. ; end ;
end;
run;

 

Then changed the first edit statement with the Source statement.

 

proc template;
Source HPSTAT.HPGenselect.ParameterEstimates ;
edit Estimate; format=Best32.; end;
edit StdErr; format=Best32.; end;
edit Effect ; format = $200. ; end ;
end;
run;

 

Then also added Path in this code.

 

proc template;
path "Hpgenselect.ParameterEstimates" ;
Source HPSTAT.HPGenselect.ParameterEstimates ;
edit Estimate; format=Best32.; end;
edit StdErr; format=Best32.; end;
edit Effect ; format = $200. ; end ;
end;
run;

 

But nothing works.

 

Can someone help me with this..??

SAS Super FREQ
Posts: 496

Re: Formats of ODS Table

Posted in reply to DipeshGupta

Make sure you are not editing versions that you incorrectly edited before.  Start by deleting any version that happens to be in sasuser. Then list the versions that exist.  You should see only one template in the table and it should come from sashelp.  If there is more than one, delete any that do not come from sashelp.  Then try editing again.

 

proc template;
delete HPSTAT.HPGenselect.ParameterEstimates / store=sasuser.templat;
list HPSTAT.HPGenselect.ParameterEstimates ;
edit HPSTAT.HPGenselect.ParameterEstimates ;
edit Estimate; format=Best32.; end;
edit StdErr; format=Best32.; end;
edit Effect ; format = $200. ; end ;
end;
source HPSTAT.HPGenselect.ParameterEstimates ;
run;

Super User
Posts: 22,845

Re: Formats of ODS Table

Posted in reply to DipeshGupta

What's your ultimate objective with editing the template, what changes are you trying to implement?

Contributor
Posts: 70

Re: Formats of ODS Table

@Reeza I want to change the format of column Effect because it is not showing the complete parameter name.

 

If I have Apple*Banana*Grapes then it is only giving me App*Bana*Grap

 

But I want the complete name of all the parameters.\

 

@WarrenKuhfeld I am getting an error msg :

 

291 proc template;
292 delete HPSTAT.HPGenselect.ParameterEstimates /
292 ! store=sasuser.templat;
ERROR: Write access to member SASUSER.TEMPLAT.ITEMSTOR is
denied.
NOTE: Could not delete 'HPSTAT.HPGenselect.ParameterEstimates'
from template store!
293 list HPSTAT.HPGenselect.ParameterEstimates ;
294 edit HPSTAT.HPGenselect.ParameterEstimates ;
31 The SAS System
09:25 Monday, September 4, 2017

295 edit Estimate; format=Best32.; end;
296 edit StdErr; format=Best32.; end;
297 edit Effect ; format = $200. ; end ;
298 end;

Esteemed Advisor
Posts: 5,398

Re: Formats of ODS Table

Posted in reply to DipeshGupta

ParameterEstimates is a fairly simple table. It might be easier to do your own reporting. Starting from an example from the HPGENSELECT documentation:

 


proc hpgenselect data=getStarted;
   class C1-C5;
   model Y = C1-C5 / Distribution=Poisson;
   selection method=forward details=all;
   ods output parameterestimates=pe;
run;

title;
option nodate nonumber;
ods rtf file="&sasforum.\reports\hpgenselectParameters.rtf" style=journal;
proc sql;
select 
    parameter,
    df,
    estimate,
    stdErr,
    ChiSq format=6.2,
    ProbChiSq
from pe;
quit;

ods rtf close;
PG
Contributor
Posts: 70

Re: Formats of ODS Table

@PGStats Which address to we need to give at the place of &sasforums.

 

Where does the reports get stored on SAS..??

I don't have any idea about that. 

Please help.

Esteemed Advisor
Posts: 5,398

Re: Formats of ODS Table

Posted in reply to DipeshGupta

The example produces output to the results window and to a RTF file. You can simply remove the ODS RTF statements if you don't need that. The file="" option must state a full reachable path on your system.

PG
Contributor
Posts: 70

Re: Formats of ODS Table

@But where is the report file of parameterestimates created by hpgenselect is stored.

 

How to identify the path of the report file created by hpgenselect..?? 

Esteemed Advisor
Posts: 5,398

Re: Formats of ODS Table

Posted in reply to DipeshGupta

On my system, reports are sent to the results window, not to a file. To get the reports into a file, I must specify an ODS destination, such as the RTF destination in my example. Your system might have a different configuration.

 

You should get familiar with the output delivery system (ODS) before attempting to modify templates.

PG
Super User
Posts: 22,845

Re: Formats of ODS Table

Posted in reply to DipeshGupta

You specified the path of the RTF file in the FILE option on the ODS RTF statement. Or the log will say the location.

Contributor
Posts: 70

Re: Formats of ODS Table

I got this is the log.,

 

Name: ParameterEstimates
The SAS System

Label: Parameter Estimates
Template: HPSTAT.HPGenselect.ParameterEstimates
Path: Hpgenselect.ParameterEstimates

 

and then I used this path in the code but again ended up in error,

 

title;
option nodate nonumber;
ods rtf file="Hpgenselect.ParameterEstimates\reports\hpgenselectParameters.rtf" style=journal;
proc sql;
select
Effect format=$2000.,
parameter,
df,
estimate,
stdErr,
ChiSq,
ProbChiSq
from Model.InteractionChart ;
quit;

ods rtf close;

 

 

 

Error

 

ERROR: Physical file does not exist,
D:\sasconf\Config\Lev1\SASApp\Hpgenselect.ParameterEstima
tes\reports\hpgenselectParameters.rtf.
ERROR: Fatal ODS error has occurred. Unable to continue
processing this output destination.

Esteemed Advisor
Posts: 5,398

Re: Formats of ODS Table

Posted in reply to DipeshGupta

It looks like the following destination should at least exist on your system

 

file="D:\sasconf\Config\Lev1\SASApp\hpgenselectParameters.rtf"

PG
Contributor
Posts: 70

Re: Formats of ODS Table

proc template;
delete HPSTAT.HPGenselect.ParameterEstimates / store=Model.templat;
list HPSTAT.HPGenselect.ParameterEstimates ;
edit HPSTAT.HPGenselect.ParameterEstimates ;
edit Estimate; format=Best32.; end;
edit StdErr; format=Best32.; end;
edit Effect ; format = $200. ; end ;
end;
source HPSTAT.HPGenselect.ParameterEstimates ;
run;

 

 

This code ran successfully without any errors but the format of the output didn't change.

What to do..??

SAS Super FREQ
Posts: 496

Re: Formats of ODS Table

https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_ods_sect006...

http://go.documentation.sas.com/?docsetId=statug&docsetTarget=statug_ods_examples02.htm&docsetVersio...

 

It might be that sasuser is not the default template store for you.  Defaults do vary by site.  Use the ods path and ods trace statements to find out where templates are coming from and where the one you are modifying is going to.

Ask a Question
Discussion stats
  • 13 replies
  • 385 views
  • 0 likes
  • 4 in conversation