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?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1220 views
  • 0 likes
  • 5 in conversation