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..??
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;
What's your ultimate objective with editing the template, what changes are you trying to implement?
@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;
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;
@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.
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.
@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..??
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.
You specified the path of the RTF file in the FILE option on the ODS RTF statement. Or the log will say the location.
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.
It looks like the following destination should at least exist on your system
file="D:\sasconf\Config\Lev1\SASApp\hpgenselectParameters.rtf"
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..??
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.