BookmarkSubscribeRSS Feed
Sathya3
Obsidian | Level 7
libname s_ice hadoop server='gb234" schema="rst_s_ice__production";

proc sql;
create table tablelist as select MEMNAME as table_list from dictionary.tables where libname="S_ICE";
quit;

%let folder=/sas/output/
filename outf "&folder.tablelist.xlsx";
proc export data=tablelist outfile=outf dbms=xlsx replace; sheet='rst_s_ice__production';
run;


I have to get list of table names in differnrt schemas in hadoop.I need help in modifying the given code with the help of macro to get the list of table names in different schemas such as rst_hvgrp_prod,
rst_pfm_mrt_prod,rst_rpt_sum_prod and export it to one excel with each sheet for one schema.sheet name must be same as schema_name

1 REPLY 1
PaigeMiller
Diamond | Level 26

First step in creating a macro is always to get the code to work for two iterations, in this case two schemas, without macros and without macro variables. It looks like you have errors in the code you show which must be fixed first; it looks like you haven't yet got the code working for two (or more) schemas. Once that is working, show us the code and we can help further.

--
Paige Miller

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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