Unix Batch FTP - SAS


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix Batch FTP - SAS
# 1  
Old 09-25-2007
Unix Batch FTP - SAS

Hi All,

Im trying to write a Unix FTP batch file within a program called SAS. Now i already have one for windows which works fine, but it doesnt work within unix.

I've been told that some of the commands are different from Windows to Unix, and ive looked round and am completely stumped...

Can anyone have a look at the below and tell me which parts need changing:-

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;

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


%mend ftp_create_folder;

Thanks

Shenn
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing the sas comment line using UNIX

I have tried a lot, Need your help guys. SAS Program: data one ; /* Data step */ Input name $; /*Dec variables*/ I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and... (6 Replies)
Discussion started by: saaisiva
6 Replies

2. UNIX for Dummies Questions & Answers

Remove SAS comments using UNIX

I have tried a lot, Need your help guys. SAS Program: data one ; /* Data step */ Input name $; /*Dec variables*/ I want to remove the commented part(/* Data step */) alone. I have tried using sed command but it is deleting the entire line itself. i need unix command to separate this and... (1 Reply)
Discussion started by: saaisiva
1 Replies

3. Shell Programming and Scripting

FTP in batch mode

HI, Need to ftp a bunch of files in a directory in batch mode. TRying to ftp a single file first with below code. #!/bin/ksh function ftp_files { ftp -n ${D2_SRVR} <<-EOF quote user ${D2_UID} quote pass ${D2_PWD} cd ${D2_DIR}/${D2_NAME} lcd ${D1_DIR}/${D1_NAME}/dml/ put file1 ... (6 Replies)
Discussion started by: cvsanthosh
6 Replies

4. UNIX for Dummies Questions & Answers

Performing Batch ftp without .netrc

How can I supply the userID/password when executing FTP in the batch mode? Using .netrc is not an option (prohibited per Corporate Policy). Thank you in advance. (1 Reply)
Discussion started by: compaamat
1 Replies

5. UNIX for Dummies Questions & Answers

Unix commands in Base SAS programming

hi all, iam using unix command in the basesas programming. i need to delete one folder which is dynamically creating when SAS script runs. rm -rf " dynamic foldername" iam not able to delete the folder it is saying rm: cannot remove directory `test_lin_prod_06_20091211_0516':... (2 Replies)
Discussion started by: bbc17484
2 Replies

6. Windows & DOS: Issues & Discussions

Batch file to Get New Files Only through FTP

Hi there I want to create a batch file which Get (mget) the newly added Files only from specific directory on UNIX server to specific folder on windows server using FTP, and this batch file will be scheduled on the windows server to run daily to load the new files (load the newly added files... (1 Reply)
Discussion started by: alsharq
1 Replies

7. Windows & DOS: Issues & Discussions

Batch file to Get New Files Only through FTP

Hi there I want to create a batch file which Get (mget) the newly added Files only, from specific directory on UNIX server to local folder on windows server through FTP, and this batch file will be scheduled to run daily to load the new files. help me plz :confused: (1 Reply)
Discussion started by: alsharq
1 Replies

8. UNIX for Dummies Questions & Answers

Unix and Mac setup for SAS

I'm new to the forum, so I appreciate any help you can give me. I have been at an academic institution that manages its own UNIX computing grid for running SAS. I use a Mac as my personal computer and connect remotely using an ssh terminal to conduct my analysis and store/manage my files. I'm... (3 Replies)
Discussion started by: crl21
3 Replies

9. UNIX for Dummies Questions & Answers

UNIX Batch FTP Command file

Hello, I am a UNIX newbie and this is my first posting. I need to create a batch command file to ftp from Sun/Solaris to AS/400. Here is an example file: ftp -d -i -n -v 172.28.16.22 pwd ls binary quit This is the result of executing the command file: Connected to... (10 Replies)
Discussion started by: pietro
10 Replies

10. UNIX for Dummies Questions & Answers

Batch files and FTP under Unix

Hey all, Does anyone know if Unix has an equivalent to a batch file? And if so, does it work the same way as a batch file under windows? AND, if you can answer that one, is it possible to run such a file under HP-UX and have it execute while in an FTP command line? What I need to do is... (4 Replies)
Discussion started by: ober5861
4 Replies
Login or Register to Ask a Question
LedgerSMB::Batch(3pm)					User Contributed Perl Documentation				     LedgerSMB::Batch(3pm)

NAME
LedgerSMB::Batch - Batch/voucher management model for LedgerSMB 1.3 SYNOPSIS
Batch/voucher management model for LedgerSMB 1.3 METHODS
get_new_info This gets the information required for the new batch screen. Currently this just populates the batch_number hashref value. create Saves the batch info and populates the id hashref value with the id inserted. delete_voucher($id) Deletes the voucher specified by $id. get_search_criteria Sets all hash values needed for the search interface: batch_classes List of all batch classes batch_users List of all users get_search_method (private) Determines the appropriate search method, either for empty, mini, or full searches Returns the appropriate stored proc name. get_search_results Returns the appropriate search as detected by get_search_method. get_class_id($type) Returns the class_id of batch class specified by its label. post Posts a batch to the books and makes the vouchers show up in transaction reports, financial statements, and more. delete Deletes the unapproved batch and all vouchers under it. list_vouchers Returns a list of all vouchers in the batch and attaches that list to $self->{vouchers} get Gets the batch and merges information with the current batch object. Copyright (C) 2009, The LedgerSMB core team. This file is licensed under the Gnu General Public License version 2, or at your option any later version. A copy of the license should have been included with your software. perl v5.14.2 2012-03-26 LedgerSMB::Batch(3pm)