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

Hello Everyone , I had this Error While I was Trying to run this Code , can anyone give me first an explanation why i do get it and then a hand to resolve it , that would be Great , Thank you.

 

proc sql;
create Table Proof as 
select c.id_user_uni , c.division_id as division_id , ro.cod as matr, count(*) as cont
      from Ods.R_Ord o
	  inner join DMC.cust c
	   on user_id = user_ID_dup
	  inner join ods.R_r ro
	   on ro.ordi_id = o.id_ordi AND RO.SERVICE = 0
	  inner join ods.R_matr m
	   on ro.matr_id = id_matrvand flag = 0
	  group by 
	      ID_User_Uni,
		  C.division_ID,
		  Ro.Cod
	      Having Count(*) > 1 
;
quit;

This first Query Fine For me , the problem lies in this one :

 

proc sql;
create Table Transpo as 
select id_user_uni, division_id, sum(cont) as tot_items_ident, max(cont) as max_items_ident
from Proof 
group by
      Id_User_Uni,
      Divisione_ID
Order by 
      Sum(Conta) DESC
 ;
quit;

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

Try to assign that in SELECT clause and DROP later  i.e

proc sql;
create Table Transpo(drop=temp) as 
select id_user_uni, division_id, sum(cont) as tot_items_ident, max(cont) as max_items_ident,    Sum(Conta) as temp
from Proof 
group by
      Id_User_Uni,
      Divisione_ID
Order by 
      temp DESC
 ;
quit;

 

 

 

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

Try to assign that in SELECT clause and DROP later  i.e

proc sql;
create Table Transpo(drop=temp) as 
select id_user_uni, division_id, sum(cont) as tot_items_ident, max(cont) as max_items_ident,    Sum(Conta) as temp
from Proof 
group by
      Id_User_Uni,
      Divisione_ID
Order by 
      temp DESC
 ;
quit;

 

 

 

Midi
Obsidian | Level 7

Thank's That Worked Perfectly

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 16. 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
  • 2 replies
  • 3434 views
  • 0 likes
  • 2 in conversation