Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP - Unix

Status
Not open for further replies.

shenniko

Programmer
Apr 15, 2005
52
0
0
US
Hi all,

At the moment we are running all our programs on our local machine (Rsubmit-ing them).

But due to increased workload we planning on scheduling some of them on the SAS server.

So the FTP script were using wont work, as the script is meant for windows... and i've no idea about unix..

Can anyone point out the changes i need to make to the below script to allow it to work on the unix server?

Code:
%macro ftp_create_folder(
			host = ,
			user = ,
			pass = ,
			cur_dir = ,
			new_dir = ,
			script_file = temp.txt);

	filename scr "&script_file";

	data _NULL_;

		file scr;

		put "open &host";
		put "&user";
		put "&pass";
		%if "&cur_dir" ne "" %then
			%do;
				put "cd &cur_dir";
			%end;
		put "mkdir &new_dir";
		put "close";
		put "quit";
	run;

	filename scr clear;

	*option xsync = 1;
	%sysexec ftp -s:"&script_file";
	%sysexec del "&script_file";
	*option xsync = 0;


%mend ftp_create_folder;

Thanks

Robbie
 
commands in your script file should still work
but you may have to change those lines

%sysexec ftp -s:"&script_file";
%sysexec del "&script_file";

by this

%sysexec ftp -i < "&script_file";
%sysexec rm "&script_file";

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top