The example creates a temporary SAS 'inventory' table using a DATA step with 'datalines'. This table simulates the structure and data of an ORC Hive table to make the example self-contained.
1 Code Block
DATA STEP Data
Explanation : This DATA step creates a temporary SAS dataset named 'inventory' with the same columns and data as the original Hive table. In a real scenario for reading from ADLS, this 'inventory' table should be converted to ORC format and uploaded to your Azure Data Lake Storage Gen2 account.
Copied!
DATA work.inventory;
LENGTH descr $32;
FORMAT day YYYYMMDD10.;
INPUT item descr $ price day:YYMMDD10.;
DATALINES;
4600 incandescent A19 15.54 2019-10-17
1023 led A19 14.97 2019-10-17
1023 incandescent B10 5.49 2019-10-16
4219 incandescent E12 3.97 2019-10-15
;
RUN;
1
DATA work.inventory;
2
LENGTH descr $32;
3
FORMAT day YYYYMMDD10.;
4
INPUT item descr $ price day:YYMMDD10.;
5
DATALINES;
6
4600 incandescent A19 15.542019-10-17
7
1023 led A19 14.972019-10-17
8
1023 incandescent B10 5.492019-10-16
9
4219 incandescent E12 3.972019-10-15
10
;
11
RUN;
2 Code Block
LIBNAME / PROC PRINT
Explanation : The LIBNAME statement assigns the 'mylib' libref to the ORC engine, pointing to a location in Azure. The 'storage_account_name', 'storage_application_id', and 'storage_file_system' options are used to configure the connection to the ADLS account. The 'directories_as_data=yes' option is crucial to allow access to Hive tables stored as directories. The PRINT procedure then displays the content of the ORC table 'mylib.inventory' read from ADLS. Replace 'myacct', 'b1fc955d5c-e0e2-45b3-a3cc-a1cf54120f', and 'myorcdata' with your own Azure storage account information. 'data/user' represents the path to the ORC file in ADLS.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.