Hi Team,
I want to copy excel file file from windows to Linux system and need to capture last modified date of the file. Note : We cant take take last modified date of the file from windows. Since i am using below code to copy file from Windows to Linux, Code is able to transfer file to Linux system however once after running the code the timestamp of the file is changing. Is there any way to copy file from windows to Linux without modifying file timestamp. Please help
Code :-
%smb_init(username=**MYID**, password=%str(**password**), domain=**aa.aaa.com**); %smb_load();
%smb_pull(windows=//files/Load/Test/Folder1/PIC Alerts/ABC Alerts.xlsx, linux=/sasdata/test_files/folder2/ABC_Alerts.xlsx);
You would have to retrieve the current timestamp first from the Windows file, so you can set it later on the Linux side. This would need to be done in the macro, anyway, so we will need to see the macro code.
Or, instead of the SMB protocol, use sftp with the -p option; but this requires the necessary SSH server components on the Windows side.
This seems way more complicated than creating a network share from linux to the Windows server folder - is that not an option?
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.