write_sas() creates sas7bdat files. Unfortunately the SAS file format is complex and undocumented, so write_sas() is unreliable and in most cases SAS will not read files that it produces.
write_xpt() writes files in the open SAS transport format, which has limitations but will be reliably read by SAS.
Another option is to use the foreign package which generates a delimited file and the data step syntax for reading in the file. If you're not using tempfiles - the path would make more sense than in this example and would be the actual path in the SAS code.
Thank you for your response!
Following the link you provided, it works to create a xpt file, but unable to read into SAS, error message says it is not a SAS file.
I tried your sample code, didn't find the generated dataset. Thanks.