Help using Base SAS procedures

Moving Txt and exls files

Posts: 41

Moving Txt and exls files


I need to move txt and excel and sas datasets from one location to another location. I can't use X command an Systask commands due to certain server limitations. am using proc datasets move. but am able to move only sas data sets. pls advise me how to move all type of files.

libname SR "C:\source";

libname TG "D:\Target" ;



RUN; quit;

libname SR CLEAR;

libname TG CLEAR;

Super User
Posts: 10,238

Re: Moving Txt and exls files

Posted in reply to chirumalla

SAS only works with SAS files, naturally. If you have the according modules licensed/installed, this also includes file types like .xls, .mdb, .csv and so on. In order to create/move/delete other files, you need the fitting tools, usually those supplied by the OS.

So you either need to have access to the commandline and do it with a script, or you need the X capability.

In most cases there is no real need to block that capability in SAS; properly set up server environments will always keep the user from doing (unwanted) damage.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Super User
Posts: 9,599

Re: Moving Txt and exls files

Posted in reply to KurtBremser

Just to add to KurtBremser, you could read the files and then write them out to your preferred output location assuming you have write permissions to the destination.  Otherwise, do it outside of SAS.

Trusted Advisor
Posts: 3,215

Re: Moving Txt and exls files

Posted in reply to chirumalla

Agree with Kurt, this one  is every time coming back. You are struck by some misalignment on requirements.

When an OS command is the best solution for your question, you should be able to use that.
Suppose the were a lot SAS functions bypassing the limitations of not using the OS commands. Would that

The issue is one or a combination of the following:

a/ you it-staff is not trusting you handling your own data

b/ your it-staff is not wanting to help you doing your work  

c/ your it-staff is not understanding SAS. 

    Asking the wrong questions to SAS institute, expectations of environments not conform your business policies. 

d/ SAS institute did not investigate well on the requirements by regulations and standards.

Whatever the cause of these options may be, you have to climb that mountain.  

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 3 replies
  • 1 like
  • 4 in conversation