Skip to contents

Downloads a file to the remote SAS server.

Usage

sas_file_download(sas_path, local_path)

Arguments

sas_path

string; Path of file on remote SAS server to be download

local_path

string; Path to upload SAS file to on local machine.

Value

logical; value indicating if the operation succeeded.

See also

Examples

if (FALSE) { # interactive()
# connect to SAS
sas_connect()

# create a file and upload it to SAS
tempfile_path <- tempfile(fileext = ".sas")
tempfile_basename <- basename(tempfile_path)
tempfile_path_copy <- sub("\\.sas$", "_copy.sas", tempfile_path)
cat("PROC MEANS DATA = sashelp.cars;RUN;", file = tempfile_path)
sas_file_upload(local_path = tempfile_path, sas_path = paste0("~/", tempfile_basename))

# download file from SAS
sas_file_download(paste0("~/", tempfile_basename), tempfile_path_copy)
}