- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello community, need help please.
i am trying to send file from SAS 9.4 M7 linux server to aws s3 where i have bucket and folder created with below code and receives error message. I have read this article where they are asking to get client id and secrete. Is this something must to do the handshake or we have work around?
Have fill access to s3 bucket.
/*code*/
%macro mytest;
%let file_path=/server/path/where/file/is/test.txt
%if %sysfunc(fileexist(&file_path.)); %then %do;
%put file &file_path. exist.;
filename s3 "s3://s3-bucket-name/folder";
filename local "&file_path";
data _null_;
infile local;
file s3;
input;
put _infile_;
run;
%end;
%else %do;
%put File &file_path. doesn't exist. ;
%end;
%mend;
%mytest;
====================
Error: physical file doesn't exist, ..../sasconfig/Lev1/SASApp/s3://s3-bucket-name/folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I would think that, at the least, you would have to provide AWS configuration information and credentials before being allowed to write to AWS S3. In the FILENAME S3 documentation, Example #5 includes an example of using the AWSCONFIG= and AWSCREDENTIALS= options (the documentation for these is in the PROC S3 documentation).
The example code looks like this:
filename myout s3 "/my-dir/u1.txt"
awsconfig="/u/qz/.aws/config"
awscredentials="/u/qz/.aws/credentials"
encoding="utf-8";
Hope this helps get you started.