BookmarkSubscribeRSS Feed
ARC2
Fluorite | Level 6

Say I have a SAS dataset (or a hive table) with an id variable plus variables x1-x5 and I want to read this data into a hive table with the x1-x5 in a hive array. What goes in the select statement to get those variables into an array? Or is select not the right way?

 

Thanks.

 

1 REPLY 1
Patrick
Opal | Level 21

That's not a SAS but a Hive SQL question.

After a quick Google seems there is an array() function for this.

 

From: https://dwgeek.com/hive-array-functions-usage-and-examples.html/

 
 
 

Following is the syntax of array function.

array(value1, value2, value2,...)

where, value is of type string or integer.

 
 

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

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
  • 1 reply
  • 821 views
  • 0 likes
  • 2 in conversation