Desktop productivity for business analysts and programmers

Moving External Files

Reply
Frequent Contributor
Posts: 139

Moving External Files

All

I receive through out the day raw externals files that go to drive "X" and once the SAS project finishes processing that file, it needs to be moved to drive "Y".
I would normally use the x command to do that. I know that the xcmd option is turned off by default on EG and our IT department will not turn it on due to security reasons.

There must be a way around this.
Any ideas?

-Darryl
N/A
Posts: 0

Re: Moving External Files

Simple. Many solutions. Here's two.

[pre]
filename x_in "X:\input_file.dat";
filename y_out "Y:\output_file.dat";

data process_stuff;
infile x_in;
file y_out;

input stuff;

/* process stuff */

put stuff;
run;
[/pre]

OR

[pre]
filename x_in "X:\..." ;
libname y_out "Y:\output_directory";

data y_out.processed_stuff;
infile x_in;
input stuff;

/* process stuff */

run;
quit;
[/pre]

Within EG, to do the second one, you simply add an "Assign library" task to the project that is done first, that creates the "y_out" library. Then within the appropriate processing task/node, you specify the output to go to that library.
N/A
Posts: 0

Re: Moving External Files

I am sure there are ways to perform it, but as one of the resident noobs, I wonder if its more resource efficient to perform it as a cron tab script that checks the file for some criteria before it scps it over. Message was edited by: Joshua
Ask a Question
Discussion stats
  • 2 replies
  • 106 views
  • 0 likes
  • 2 in conversation