BookmarkSubscribeRSS Feed
DavidPhillips2
Rhodochrosite | Level 12

Is there a way to pass a column label from a SAS dataset to an Oracle table and then from an Oracle table to Visual Analytics?

5 REPLIES 5
kiranv_
Rhodochrosite | Level 12

formats and labels are unique to each database and sas. So transferring them is not possible.

DavidPhillips2
Rhodochrosite | Level 12

Articles online said the same thing.  I was hoping there was an easy way though. I am looking at relabeling seven hundred labels.  I am going to look into scripting the labels in the Visual Analytics data preparation section. If I have a list of column names and what the label should be, I should be able to do a manual labeling from a semi manual script generation.

Patrick
Opal | Level 21

@DavidPhillips2

If the variables in SAS and Oracle have the same names then it shouldn't be that hard to retrieve the labels from the SAS variables (i.e. using dictionary.columns) and then generate SQL alter table statements as Oracle Pass-Through code.

SASKiwi
PROC Star

Why are you loading SAS data into Oracle and then reading it back into Visual Analytics as SAS data?

 

If you need Oracle data combined with SAS data, extract it into SAS first, build your VA load table in SAS (with labels) and load it into VA from there. That way you can keep your SAS labels without any problem.

Filipvdr
Pyrite | Level 9

if you declare your library like libname &p_inputlibref meta library="&p_saslibname";

 

This is a connection to a SQL database.

 

proc sql;
select strip(name) || "='" || strip(label) || "'" into :label_list separated by ' '
from dictionary.columns
where upcase(memname) = upcase("&_INPUTREF");
quit;
%put &label_list;

 

The only thing left is to apply this to the LASR table. At this point i'm still struggling with that because a proc datasets and modify is not allowed?

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
  • 5 replies
  • 2116 views
  • 0 likes
  • 5 in conversation