BookmarkSubscribeRSS Feed
lioradam
Obsidian | Level 7

Hello, 

In the following code, I would like to present only the result for "FM_quadric_reg_adj_ebxi3_Winz" results. but I have not succeed to do that with ODS statement.

Thank you,

Lior

 

proc sort data=FINAL out=FM_quadric_reg_adj_ebxi_a;
by GVKEY01 Full_Name;

run;

PROC REG DATA=FM_quadric_reg_adj_ebxi_a
outest=FM_quadric_reg_adj_ebxi3 noprint outseb;

MODEL Adj_m1_e_bxi_a=Year_of_Tenure year_of_tenure2;
by GVKEY01 Full_Name;

RUN;
QUIT;



proc sql;
create table FM_quadric_reg_adj_ebxi3_PARMS as
select *
from FM_quadric_reg_adj_ebxi3
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi3_PARMS2;
set FM_quadric_reg_adj_ebxi3_PARMS;
drop _type_;

run;

proc summary data=FM_quadric_reg_adj_ebxi3_PARMS2;

var intercept Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi3_summ p5= p95= / autoname;

quit;


data FM_quadric_reg_adj_ebxi3_Winz;

set FM_quadric_reg_adj_ebxi3_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi3_summ;


intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);



run;
proc means data=FM_quadric_reg_adj_ebxi3_Winz n mean t probt stderr;

run;

 

20 REPLIES 20
Kathryn_SAS
SAS Employee

Do you mean that you only want the PROC MEANS results to appear in the output destination? If so, try the following:

ods _all_ close;

proc sort data=FINAL out=FM_quadric_reg_adj_ebxi_a;
by GVKEY01 Full_Name;

run;

PROC REG DATA=FM_quadric_reg_adj_ebxi_a
outest=FM_quadric_reg_adj_ebxi3 noprint outseb;

MODEL Adj_m1_e_bxi_a=Year_of_Tenure year_of_tenure2;
by GVKEY01 Full_Name;

RUN;
QUIT;



proc sql;
create table FM_quadric_reg_adj_ebxi3_PARMS as
select *
from FM_quadric_reg_adj_ebxi3
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi3_PARMS2;
set FM_quadric_reg_adj_ebxi3_PARMS;
drop _type_;

run;

proc summary data=FM_quadric_reg_adj_ebxi3_PARMS2;

var intercept Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi3_summ p5= p95= / autoname;

quit;


data FM_quadric_reg_adj_ebxi3_Winz;

set FM_quadric_reg_adj_ebxi3_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi3_summ;


intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);



run;

ods listing;
proc means data=FM_quadric_reg_adj_ebxi3_Winz n mean t probt stderr;

run;

If this does not answer your question, please clarify what you are currently getting and what you are expecting.

lioradam
Obsidian | Level 7

Hi,

Thank you very much.

When I run the program with the single code (the code attached here), it works.

However, in my original program, there are several codes in the same program file, and in that case, it doesn't work.

(even so I enter "ods listing;" in each code).

Lior

Kathryn_SAS
SAS Employee

The code you included in the original post works for me also when I create sample data. What do you mean by "it doesn't work"? Are you getting Error messages or are you getting more output than you want in the ODS destination? Can you send code that replicates what you are describing? Other ways to prevent ODS output are to use ODS SELECT NONE; or ODS EXCLUDE ALL; and then ODS SELECT ALL; when you want to resume showing output.

 

lioradam
Obsidian | Level 7

Hi,

I receive more output than I want.

Here are the four different codes for regressions, which are included in the program:

 




proc sort data=FINAL out=FM_quadric_reg_adj_ebxi_a;
 by GVKEY01 Full_Name;


run;


PROC REG DATA=FM_quadric_reg_adj_ebxi_a
  outest=FM_quadric_reg_adj_ebxi3 noprint outseb;


MODEL Adj_m1_e_bxi_a /*EM tobin_q */= /*ln_year_of_tenure*/ Year_of_Tenure year_of_tenure2;
   by GVKEY01 Full_Name;

RUN;
QUIT;
proc sql;
create table  FM_quadric_reg_adj_ebxi3_PARMS as 
select *
from FM_quadric_reg_adj_ebxi3
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi3_PARMS2;
set FM_quadric_reg_adj_ebxi3_PARMS;
drop _type_;

run;

proc summary data=FM_quadric_reg_adj_ebxi3_PARMS2;
 
var intercept /*ln_year_of_tenure */Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi3_summ p5= p95= / autoname;
  
quit;


data FM_quadric_reg_adj_ebxi3_Winz;

set FM_quadric_reg_adj_ebxi3_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi3_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);


run;
ods listing;
proc means data=FM_quadric_reg_adj_ebxi3_Winz n mean t probt stderr;

run;


PROC REG DATA=FM_quadric_reg_adj_ebxi_a
  outest=FM_quadric_reg_adj_ebxi2 noprint outseb;
 
MODEL Adj_m1_e_bxi_a /*EM tobin_q*/ = Year_of_Tenure year_of_tenure2;
   by GVKEY01 Full_Name;
 
    
RUN;
QUIT;
proc sql;
create table  FM_quadric_reg_adj_ebxi2_PARMS as 
select *
from FM_quadric_reg_adj_ebxi2
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi2_PARMS2;
set FM_quadric_reg_adj_ebxi2_PARMS;
drop _type_;

run;

proc summary data=FM_quadric_reg_adj_ebxi2_PARMS2;
 
var intercept Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi2_summ p5= p95= / autoname;
  
quit;


data FM_quadric_reg_adj_ebxi2_Winz;

set FM_quadric_reg_adj_ebxi2_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi2_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);


run;
ods listing;
proc means data=FM_quadric_reg_adj_ebxi2_Winz n mean t probt stderr;

run;



proc sort data=FINAL out= cl_adj_ebxi1_a_fm;
by GVKEY01 Full_Name 'Data Year - Fiscal'n ;
RUN;

PROC REG data=cl_adj_ebxi1_a_fm
	outest=cl_adj_ebxi1_a  noprint outseb;

model Adj_m1_e_bxi_a /*EM/* tobin_q */= year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;

 by GVKEY01 Full_Name;

run;
quit;


proc sql;
create table  cl_adj_ebxi1_a_PARMS as 
select *
from cl_adj_ebxi1_a
where _type_ = "PARMS";


data cl_adj_ebxi1_a_PARMS2;
set cl_adj_ebxi1_a_PARMS;
drop _type_;

run;

proc summary data=cl_adj_ebxi1_a_PARMS2;
 
var intercept year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
output out=cl_adj_ebxi1_a_summ p5= p95= / autoname;
  
quit;


data cl_adj_ebxi1_a_Winz;

set cl_adj_ebxi1_a_PARMS2;
if _n_ = 1 then set
cl_adj_ebxi1_a_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
DM_ebxi_X_winz = min(max(DM_ebxi_X, DM_ebxi_X_p5), DM_ebxi_X_p95);
DM_adj_ebxi_a_winz = min(max(DM_adj_ebxi_a, DM_adj_ebxi_a_p5), DM_adj_ebxi_a_p95);


run;
ods listing;
proc means data=cl_adj_ebxi1_a_Winz n mean t probt;
 
run;

proc sort data=FINAL out= cl_adj_ebxi2_a_fm;
by GVKEY01 Full_Name 'Data Year - Fiscal'n ;

PROC REG data=cl_adj_ebxi2_a_fm
	outest=cl_adj_ebxi2_a  noprint outseb;

model Adj_m1_e_bxi_a /*EM /*tobin_q*/=year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;

 by GVKEY01 Full_Name;

run;
quit;


proc sql;
create table  cl_adj_ebxi2_a_PARMS as 
select *
from cl_adj_ebxi2_a
where _type_ = "PARMS";


data cl_adj_ebxi2_a_PARMS2;
set cl_adj_ebxi2_a_PARMS;
drop _type_;

run;

proc summary data=cl_adj_ebxi2_a_PARMS2;
 
var intercept year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
output out=cl_adj_ebxi2_a_summ p5= p95= / autoname;

quit;


data cl_adj_ebxi2_a_Winz;

set cl_adj_ebxi2_a_PARMS2;
if _n_ = 1 then set
cl_adj_ebxi2_a_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
DM_ebxi_X_winz = min(max(DM_ebxi_X, DM_ebxi_X_p5), DM_ebxi_X_p95);
DM_adj_ebxi_a_winz = min(max(DM_adj_ebxi_a, DM_adj_ebxi_a_p5), DM_adj_ebxi_a_p95);



ods listing;
proc means data=cl_adj_ebxi2_a_Winz n mean t probt;
 
run;


 

Quentin
Super User

In your code, you never close the listing destination.  If you only want the PROC MEANS results to print to the listing, you need to close the listing destination before your first PROC REG, then  before each PROC MEANS step open the listing destination, and after the PROC MEANS step close the listing destination.  You could do that like:

 

ods _all_ close;

proc sort data=FINAL out=FM_quadric_reg_adj_ebxi_a;
 by GVKEY01 Full_Name;
run;


PROC REG DATA=FM_quadric_reg_adj_ebxi_a
  outest=FM_quadric_reg_adj_ebxi3 noprint outseb;


MODEL Adj_m1_e_bxi_a /*EM tobin_q */= /*ln_year_of_tenure*/ Year_of_Tenure year_of_tenure2;
   by GVKEY01 Full_Name;
RUN;
QUIT;
proc sql;
create table  FM_quadric_reg_adj_ebxi3_PARMS as 
select *
from FM_quadric_reg_adj_ebxi3
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi3_PARMS2;
set FM_quadric_reg_adj_ebxi3_PARMS;
drop _type_;
run;

proc summary data=FM_quadric_reg_adj_ebxi3_PARMS2;
var intercept /*ln_year_of_tenure */Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi3_summ p5= p95= / autoname;
quit;


data FM_quadric_reg_adj_ebxi3_Winz;

set FM_quadric_reg_adj_ebxi3_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi3_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);


run;

ods listing;
proc means data=FM_quadric_reg_adj_ebxi3_Winz n mean t probt stderr;
run;
ods listing close;

PROC REG DATA=FM_quadric_reg_adj_ebxi_a
  outest=FM_quadric_reg_adj_ebxi2 noprint outseb;
 
MODEL Adj_m1_e_bxi_a /*EM tobin_q*/ = Year_of_Tenure year_of_tenure2;
   by GVKEY01 Full_Name;  
RUN;
QUIT;
proc sql;
create table  FM_quadric_reg_adj_ebxi2_PARMS as 
select *
from FM_quadric_reg_adj_ebxi2
where _type_ = "PARMS";


data FM_quadric_reg_adj_ebxi2_PARMS2;
set FM_quadric_reg_adj_ebxi2_PARMS;
drop _type_;
run;

proc summary data=FM_quadric_reg_adj_ebxi2_PARMS2;
var intercept Year_of_Tenure year_of_tenure2;
output out=FM_quadric_reg_adj_ebxi2_summ p5= p95= / autoname;
quit;


data FM_quadric_reg_adj_ebxi2_Winz;
set FM_quadric_reg_adj_ebxi2_PARMS2;
if _n_ = 1 then set
FM_quadric_reg_adj_ebxi2_summ; 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
year_of_tenure2_winz = min(max(year_of_tenure2, year_of_tenure2_p5), year_of_tenure2_p95);
run;

ods listing;
proc means data=FM_quadric_reg_adj_ebxi2_Winz n mean t probt stderr;
run;
ods listing close;


proc sort data=FINAL out= cl_adj_ebxi1_a_fm;
by GVKEY01 Full_Name 'Data Year - Fiscal'n ;
RUN;

PROC REG data=cl_adj_ebxi1_a_fm
	outest=cl_adj_ebxi1_a  noprint outseb;
model Adj_m1_e_bxi_a /*EM/* tobin_q */= year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
 by GVKEY01 Full_Name;
run;
quit;


proc sql;
create table  cl_adj_ebxi1_a_PARMS as 
select *
from cl_adj_ebxi1_a
where _type_ = "PARMS";


data cl_adj_ebxi1_a_PARMS2;
set cl_adj_ebxi1_a_PARMS;
drop _type_;
run;

proc summary data=cl_adj_ebxi1_a_PARMS2;
var intercept year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
output out=cl_adj_ebxi1_a_summ p5= p95= / autoname;
quit;


data cl_adj_ebxi1_a_Winz;

set cl_adj_ebxi1_a_PARMS2;
if _n_ = 1 then set
cl_adj_ebxi1_a_summ; 

 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
DM_ebxi_X_winz = min(max(DM_ebxi_X, DM_ebxi_X_p5), DM_ebxi_X_p95);
DM_adj_ebxi_a_winz = min(max(DM_adj_ebxi_a, DM_adj_ebxi_a_p5), DM_adj_ebxi_a_p95);
run;

ods listing;
proc means data=cl_adj_ebxi1_a_Winz n mean t probt;
run;
ods listing close;

proc sort data=FINAL out= cl_adj_ebxi2_a_fm;
by GVKEY01 Full_Name 'Data Year - Fiscal'n ;

PROC REG data=cl_adj_ebxi2_a_fm
	outest=cl_adj_ebxi2_a  noprint outseb;
model Adj_m1_e_bxi_a /*EM /*tobin_q*/=year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
 by GVKEY01 Full_Name;
un;
quit;


proc sql;
create table  cl_adj_ebxi2_a_PARMS as 
select *
from cl_adj_ebxi2_a
where _type_ = "PARMS";


data cl_adj_ebxi2_a_PARMS2;
set cl_adj_ebxi2_a_PARMS;
drop _type_;
run;

proc summary data=cl_adj_ebxi2_a_PARMS2;
var intercept year_of_tenure DM_ebxi_X  DM_adj_ebxi_a;
output out=cl_adj_ebxi2_a_summ p5= p95= / autoname;
quit;


data cl_adj_ebxi2_a_Winz;
set cl_adj_ebxi2_a_PARMS2;
if _n_ = 1 then set
cl_adj_ebxi2_a_summ; 
intercept_winz = min(max(intercept, intercept_p5), intercept_p95);
Year_of_Tenure_winz = min(max(Year_of_Tenure, Year_of_Tenure_p5), Year_of_Tenure_p95);
DM_ebxi_X_winz = min(max(DM_ebxi_X, DM_ebxi_X_p5), DM_ebxi_X_p95);
DM_adj_ebxi_a_winz = min(max(DM_adj_ebxi_a, DM_adj_ebxi_a_p5), DM_adj_ebxi_a_p95);



ods listing;
proc means data=cl_adj_ebxi2_a_Winz n mean t probt;
run;
lioradam
Obsidian | Level 7

Hi,

Thank you, but it doesn't work.

I still receive too many results.

 

Lior

Quentin
Super User

If you clear your results, and then run that code, in addition to the PROC MEANS output, what other output do you see?

lioradam
Obsidian | Level 7

I see:

FM_QUADRIC_REG_ADJ_EBXI_A

FM_QUADRIC_REG_ADJ_EBXI3

FM_QUADRIC_REG_ADJ_EBXI3_PARMS

FM_QUADRIC_REG_ADJ_EBXI3_PARMS2

FM_QUADRIC_REG_ADJ_EBXI3_SUMM

FM_QUADRIC_REG_ADJ_EBXI2

 

and many others

Quentin
Super User

Those are the names of datasets.  You shouldn't see them in your results window.  But if you're using Enterprise Guide, or another IDE, you may see icons for the output datasets that were created.  

 

Are you using Enterprise Guide, Studio, or something else?

 

Can you post a screen shot of what you're seeing?

lioradam
Obsidian | Level 7

Yes, I use Enterprise Guide.

Those icons make my process flow look complicated.

Is there a way to avoid seeing them?

 

thank,

Lior

 

lioradam_0-1758634937637.png

 

Quentin
Super User

Thanks for image.  Yes, there is an option you can set that will stop those dataset icons from being added to your flow.  See my second post: 

https://communities.sas.com/t5/New-SAS-User/ODS-function/m-p/975570/highlight/true#M43510

lioradam
Obsidian | Level 7

Thank you, but there are cases when I wank to see the icons to continue building the process flow from that database.

When I follow your instructions for signal regression, it works; I see only the results (icons) that I wanted to see.

 

But with several regressions, it doesn't work.

Here is an example of an icon of a result that I use to build another database:

lioradam_0-1758636627605.png

 

Lior

Quentin
Super User

In my experience setting that option to 0 has always worked to prevent all output datasets from being added to the process flow.  Maybe someone else will have an idea.

lioradam
Obsidian | Level 7

Thank you very much for trying!

Highly appreciated.

 

Lior

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 20 replies
  • 2433 views
  • 2 likes
  • 4 in conversation