BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

Hi all,

 

Has anyone of you ever come across the need to construct a libname statement from its metadata definition?

What I've got is the libref. What I want is to query SAS metadata for this libref and fully generate the libname statement.

 

I know how to query metadata but I'm concerned that what I'm after could become quite involved to end up with something robust and production worthy.

What I hope someone here can provide: A) the expertise by having done that already so I get a better idea how complicated and involved this is and B) ideally some working code (partial or full solution)

 

A bit more background

I'm dealing with a situation where I've got a data driven process and one of the parameters my process gets is the source and target librefs (for Hadoop and CAS).

I can't pre-assign the libraries (at least not the ones for Hadoop) so I need to somehow generate the libname statements in my code - or if that's possible need to tell SAS to execute the metadata library definition which belongs to the libref I'm getting.

I'm using authentication domains so there is no need to derive the user and password from metadata should that be an issue.

The batch user executing the process will have all the metadata access required (but won't be an unrestricted user).

Environment is: SAS9.4M5 under RHEL.

 

Adding @ErikLund_Jensen because I believe you've done a lot in this area. 

 

Thanks,

Patrick

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Maybe i am missing something, but can't you just use the libref in the libname-statement?

 

libname lina meta liburi="SASLibrary?@Libref='lina'";

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

Maybe i am missing something, but can't you just use the libref in the libname-statement?

 

libname lina meta liburi="SASLibrary?@Libref='lina'";
Patrick
Opal | Level 21

@andreas_lds wrote:

Maybe i am missing something, but can't you just use the libref in the libname-statement?

 

libname lina meta liburi="SASLibrary?@Libref='lina'";

OMG! No, you haven't missed anything. I did. How good I've asked before wasting time on a totally wrong approach. 🙂

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
  • 2 replies
  • 1207 views
  • 1 like
  • 2 in conversation