Help using Base SAS procedures

Moving Txt and exls files

Reply
Contributor
Posts: 41

Moving Txt and exls files

Hi,

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" ;

PROC DATASETS;

COPY IN=SR OUT=TG MOVE MEMTYPE=ALL;

RUN; quit;

libname SR CLEAR;

libname TG CLEAR;

Super User
Posts: 6,946

Re: Moving Txt and exls files

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
Super User
Super User
Posts: 7,406

Re: Moving Txt and exls files

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.

Valued Guide
Posts: 3,208

Re: Moving Txt and exls files

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 help....no.

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
  • 238 views
  • 1 like
  • 4 in conversation