BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Radwan
Quartz | Level 8

Hello 

i have an issue in my sas program which is when i run reg or mean statements immediately it out the results and graphics whereas i do not wanna the graphics because it takes looooooong time for processing.

for instant : i just run this statement 

proc reg data=found outest=equation1;
model CASFO_real= TA1 S1 S2/ noint adjsrq; 
by year industrycode;
run; 

but it seems that SAS checks all observations one by one as in the attached picture Untitled.png  

 so please i need just get the table and then i will check the results in the table.

how can i do that easy way?

thank you in advance 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Add option PLOTS=NONE to the proc reg statement, this will prevent the default graphs from being produced. The same applies to many stats procs. Check the documentation.

PG

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

In this situation, the first line in your program should be

 

ods graphics off;

Since we are helping you, please help us out by changing the title of this thread to something more meaningful.

--
Paige Miller
PGStats
Opal | Level 21

Add option PLOTS=NONE to the proc reg statement, this will prevent the default graphs from being produced. The same applies to many stats procs. Check the documentation.

PG
Radwan
Quartz | Level 8
thank you.
i have another problem when i run sql statement i got this message ( 83 proc sql;
84 create table vars as select
84 ! a.code,a.year1,a.Total_assets,a.leverage,a.Recievables,b.soe,c.ROA,c.ROE
85 from Reda as a, Seo as b, Roa as c
86 where a.code=b.code=c.code and a.year1=b.year1=c.year1;
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: Expression using equals (=) has components that are of different data types.
87 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds
)
what does that mean?
PGStats
Opal | Level 21

Try

 

where a.code=b.code and a.code=c.code and a.year1=b.year1 and a.year1=c.year1

 

as your where condition. A condition such as a.code=b.code=c.code is interpreted as (a.code=b.code)=c.code, which becomes 1 = c.code or 0 = c.code... not what you want.

PG
Radwan
Quartz | Level 8

Hi 

i just tried your suggestion but it does not work 

i m wondering why when i use same condition with different tables it works as follows 

proc sql;
create table erm_var as select a.code,a.year1,a.sales,a.COGS,a.SE,a.M_cost,b.CSFO,c.INVentory,d.Total_assets,e.RDSpendSum,
f.indusCode
from alkebsee as a, radwan as b, zahra as c, reda as d, hassan as e, indus as f
where a.code=b.code=c.code=d.code=e.code=f.code and a.year1=b.year1=c.year1=d.year1=e.year1;
quit; 

96 proc sql;
97 create table erm_var as select
97 ! a.code,a.year1,a.sales,a.COGS,a.SE,a.M_cost,b.CSFO,c.INVentory,d.Total_assets,e.RDSpendSum,
98 f.indusCode
99 from alkebsee as a, radwan as b, zahra as c, reda as d, hassan as e, indus as f
100 where a.code=b.code=c.code=d.code=e.code=f.code and a.year1=b.year1=c.year1=d.year1=e.year1;
NOTE: Table WORK.ERM_VAR created, with 15196 rows and 11 columns.

101 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.21 seconds
cpu time 0.18 seconds

 

 

but when i use it with other tables it does not work as follows

proc sql;
create table con_var as 
select a.code,a.year1,a.gender,a.Total_pay,b.ROA,b.ROE,c.soe,d.boardsize,
d.number_of_independent_directors,e.INVentory,f.Total_assets,f.leverage,f.Recievables, g.indusCode
from indp as a, roft as b, soe as c, board as d, zahra as e, reda as f, indus AS g
where a.code=b.code=c.code=d.code=e.code=f.code=g.code
and a.year1=b.year1=c.year1=d.year1=e.year1=f.year1;
quit;

 


117 proc sql;
118 create table con_var as
119 select a.code,a.year1,a.gender,a.Total_pay,b.ROA,b.ROE,c.soe,d.boardsize,
120 d.number_of_independent_directors,e.INVentory,f.Total_assets,f.leverage,f.Recievables,
120! g.indusCode
121 from indp as a, roft as b, soe as c, board as d, zahra as e, reda as f, indus AS g
122 where a.code=b.code=c.code=d.code=e.code=f.code=g.code
123 and a.year1=b.year1=c.year1=d.year=e.year1=f.year1;
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: Expression using equals (=) has components that are of different data types.
124 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds

 

 

could you please figure out the reason ?

Radwan
Quartz | Level 8
ohhh i got it
the reason is i have file as data file (.dta) extension, inside this file the code data is character not numeric. so it is not same type. Here, the rest of file the code data look like (1,2,3, ....) but in that file it look like (000001, 000002,....). now i need the code that converts character type into numeric type .
please

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1338 views
  • 1 like
  • 3 in conversation