Desktop productivity for business analysts and programmers

Change Library in SAS EG?

Occasional Contributor
Posts: 13

Change Library in SAS EG?

Hello Everybody,

Searched different user communities but not able to find any answers.

I have created a project which creates few hundred permanent datasets. Now the problem is I have to create similar datasets for two different scenarios.

So what I want to do is to find a way(options, macro) to change the library of the datasets which will prevent me from overwrite the datasets.

I use SAS EG 4.3.

Thanks in advance!



Trusted Advisor
Posts: 3,215

Re: Change Library in SAS EG?

This scenario is very common with advanced testing (DTAP design) .
When you have the library definition (libname statement) not being coded inside your program but separated and being under control by a setting than what is the problem?

You cannot secure those datasets unless you are the security admin yourself. The only other approach is having backup/restore options for those parts of data     

---->-- ja karman --<-----
Occasional Contributor
Posts: 13

Re: Change Library in SAS EG?

May Be I was not clear the 1st time.

What I am trying to do is to just take a copy of the same SAS Project and change some parameters for the new scenario. The only hindrance that I am facing is if I run the copied project with new scenario the datasets with old scenario information will be over written. Which I don't want to do. And I may need to run both the scenarios somtimes parallely also.

I am looking for a solution pretty similar to the Migration Utility where it list down the Libraries and we have to provide the new library name in the new servers.



Super User
Posts: 10,574

Re: Change Library in SAS EG?

If the datasets are all created in the same logical library, you only have to change that libref. Once a new physical location is assigned to the same logical name, all datasets are written to the new location.

That's actually what the whole libraries thing is for.

To make the whole thing even easier, you can create a prompt in EG to ask for the scenario and then assign the libname accordingly.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 3 replies
  • 1 like
  • 3 in conversation