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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3909 views
  • 0 likes
  • 2 in conversation