Assign a library

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

Assign a library

Hi

Is it possible to write a code that would assign certain libraries existing on a server? I want to insert this code into my other code that takes data from few different libraries because assigning them manually takes time. Also I don't want them to be pre-assigned in SAS library settings because I need these libraries only for this particular code.

Thank you in advance.


Accepted Solutions
Solution
‎10-01-2014 02:52 AM
Valued Guide
Posts: 3,208

Re: Assign a library

Donitk, Writing code to assign libnames into code is an old classic way of doing that.
Writing physical names into code is however one of the bad-practices. The reason is it makes codes not any more deployable to other physical environments.

That can be solved by using global environment (macro) vars or using the pathname function.

    
As you are asking this is is probably locked for you. The libname function can be made disfunctional by your technical support (platform admin) as he is not trusting you working on your data. See: SAS(R) 9.4 Statements: Reference, Third Edition. In that situation you have to go back for that political issue.

Pre-assigning libraries and SAS metadata driven working dogma-s are not always viable for every situation. It is a pitty SAS people are pushing that too hard. 

Aside the statement there is also a libname  function that one can be used in a datastep or macro functions. SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition. With that thre are alos open close and read functions to access data in a library in that way.

---->-- ja karman --<-----

View solution in original post


All Replies
Solution
‎10-01-2014 02:52 AM
Valued Guide
Posts: 3,208

Re: Assign a library

Donitk, Writing code to assign libnames into code is an old classic way of doing that.
Writing physical names into code is however one of the bad-practices. The reason is it makes codes not any more deployable to other physical environments.

That can be solved by using global environment (macro) vars or using the pathname function.

    
As you are asking this is is probably locked for you. The libname function can be made disfunctional by your technical support (platform admin) as he is not trusting you working on your data. See: SAS(R) 9.4 Statements: Reference, Third Edition. In that situation you have to go back for that political issue.

Pre-assigning libraries and SAS metadata driven working dogma-s are not always viable for every situation. It is a pitty SAS people are pushing that too hard. 

Aside the statement there is also a libname  function that one can be used in a datastep or macro functions. SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition. With that thre are alos open close and read functions to access data in a library in that way.

---->-- ja karman --<-----
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 178 views
  • 0 likes
  • 2 in conversation