BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
dipand
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

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

View solution in original post

4 REPLIES 4
sbxkoenk
SAS Super FREQ

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

dipand
Quartz | Level 8

@sbxkoenk  

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:

 

ERROR: Could not put file.
ERROR: HTTP/1.1 404 Not found

 

I think we need to ask who runs the bucket of controls.
Thanks again

dipand
Quartz | Level 8

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

 

sbxkoenk
SAS Super FREQ

@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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 876 views
  • 1 like
  • 2 in conversation