Dear All,
I have to write an excel file in a s3 bucket. From the SAS manual I read that you can use the S3 proc, specifying some parameters like :
%let access_key = "XXXXXXXXXXXXXXXXXXXXXXXXXX";
%let secret_key = "XXXXXXXXXXXXXXXXXXXXXXX";
The administrator of bucket s3 gave me only the bucket and no other information because he thinks it is not necessary, as my SAS server is authorized both in writing and in reading.
Can I do this in SAS? If so, how can I do it?
Thanks to those who can answer
Hello @dipand ,
Your SAS administrators and enterprise IT-architecture people have probably made sure you can write to your S3-bucket without access key and without secret key.
You only need your region name and your bucket name then.
For writing an Excel file from the file system (NFS) to your team's S3-bucket, try something like this :
proc s3 REGION=...;
/* Execute the PUT statement to copy the local file licj.xlsx
into a file of the same name in the S3 bucket myBucket. */
put "/u/marti/project/licj.xlsx" "/myBucket/licj.xlsx";
list "/myBucket";
run;
Documentation S3 Procedure : https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1h9c1jnr8v8nwn1l6g83kyne5ds.htm
Are you on AWS or are you using Dell ECS S3 (ECS delivers rich S3-compatibility)?
Koen
Hello @dipand ,
Your SAS administrators and enterprise IT-architecture people have probably made sure you can write to your S3-bucket without access key and without secret key.
You only need your region name and your bucket name then.
For writing an Excel file from the file system (NFS) to your team's S3-bucket, try something like this :
proc s3 REGION=...;
/* Execute the PUT statement to copy the local file licj.xlsx
into a file of the same name in the S3 bucket myBucket. */
put "/u/marti/project/licj.xlsx" "/myBucket/licj.xlsx";
list "/myBucket";
run;
Documentation S3 Procedure : https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n1h9c1jnr8v8nwn1l6g83kyne5ds.htm
Are you on AWS or are you using Dell ECS S3 (ECS delivers rich S3-compatibility)?
Koen
Thank you for your answer.
I’m not familiar with bucket S3, I’m told it’s AWS.
Trying your code by entering the region I get the following error message:
I think we need to ask who runs the bucket of controls.
Thanks again
Dear @sbxkoenk,
thanks to your advice I was able to communicate with the bucket S3.
Next month the SAS platform will be migrated to Azure cloud. I did some testing and the communication with the bucket is currently not working. You need to ask the colleagues who run the bucket for a <access id> and <secrect key>? Is SAS ip server authorization also required?
Thank you very much
Andrew
@dipand wrote:
Next month the SAS platform will be migrated to Azure cloud. I did some testing and the communication with the bucket is currently not working. You need to ask the colleagues who run the bucket for a <access id> and <secrect key>? Is SAS ip server authorization also required?
Microsoft Azure does not offer S3-compatible storage out-of-the-box.
Was your Microsoft Azure Blob storage extended with S3-compatible API, making it possible for S3-native applications to store data in Azure??
With regard to SAS ip server authorization ... I am sorry, that's too far out of my comfort zone. Not being a SAS administrator with installation and SAS-environment deployment expertise myself , I cannot respond to this.
Koen
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: