BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lydiawawa
Lapis Lazuli | Level 10

Hi,

 

I'm trying to create row number in a Hive table and pull it to a SAS table, but for some reason the SAS table cannot be created. There are no error or warning. It is just after running, the SAS table does not exist and cannot be located in the defined library. However, if I do not have the code that creates row number before converting to SAS table, the table will be saved. Following is the code for creating row number and taking the first row within id groups on Hive table and convert it to SAS table:

 

proc sql;
connection using df20;
/*I omitted the code that created temp table id_f */

execute (create temporary table id_f1 as
  	select *
	from (
    select 
        *, ROW_NUMBER() OVER (partition by id) as rownum
    from id_f 
	
	) ranked
	where ranked.rownum = 1
by df20;


/*pull view of final id table to SAS server*/
create table myfolder.id_f2 as
	select * from connection to df20
		(select * from id_f1);
		
Disconnect from df20;


quit;

Appreciate any help!

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

I don't think that PROC SQL has seen your QUIT statement.  You have unbalanced parentheses (5 open parens and 4 close parens), so it looks like the QUIT is embedded in the EXECUTE clause.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

View solution in original post

3 REPLIES 3
mkeintz
PROC Star

I don't think that PROC SQL has seen your QUIT statement.  You have unbalanced parentheses (5 open parens and 4 close parens), so it looks like the QUIT is embedded in the EXECUTE clause.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
r_behata
Barite | Level 11

Do you know the HDFS path for your Temp Schema ? Check to see if you notice any files there. 

 

These options will enable additional additional details in your log.

 

options SASTRACE="ds" sastraceloc=saslog nostsuffix;
options msglevel=i;
lydiawawa
Lapis Lazuli | Level 10

Thank you all for looking into this case. It is caused by the missing parentheses, and I would definitely use @r_behata for checks. Sorry for the kinda "stupid" question..

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 819 views
  • 2 likes
  • 3 in conversation