Hello to all, I have to transfer a file from the sas server to another via SFTP connection. My system administrator installed the private key on the server. I try to run the following code:
filename out sftp "SPM_KPI_HSEQALL_MAY2023.csv" host='XXXXXXX' debug
cd='01_IMPORTED_KPI' user='XXXXX' optionsx='-i /home/risorse/asea007/.ssh/SPM_PVTK.ppk -pw "XXXXXX"';
data _null_;
infile "/sasgrid/hseq/1_0/SPM_KPI_HSEQALL_MAY2023.csv" recfm=n ;
input x $char1. @@;
file out recfm=s;
put x $char1. @@;
run;
Can you help me figure out if there’s something wrong with the code?
Thank you
Hi resolved, there was a problem with key authoritazion.
the correct code:
filename out sftp "SPM_KPI_HSEQALL_MAY2023.csv" host='XXXXXXXXX' debug
cd='01_IMPORTED_KPI' user='XXXXXXXXX' optionsx='-i /home/aaa/.ssh/SPM_PVTK.ppk';
data _null_;
infile "/sasgrid/hseq/1_0/SPM_KPI_HSEQALL_MAY2023.csv" recfm=n ;
input x $char1. @@;
file out recfm=s;
put x $char1. @@;
run;
Than you
And the text of the actual error is?
Need to see the actual error message(s). You may need to provide the log of the entire code as things with libnames that aren't reported as errors sometimes make them unusable for specific tasks.
@dipand wrote:
Hello to all, I have to transfer a file from the sas server to another via SFTP connection. My system administrator installed the private key on the server. I try to run the following code:
filename out sftp "SPM_KPI_HSEQALL_MAY2023.csv" host='XXXXXXX' debug
cd='01_IMPORTED_KPI' user='XXXXX' optionsx='-i /home/risorse/asea007/.ssh/SPM_PVTK.ppk -pw "XXXXXX"';data _null_;
infile "/sasgrid/hseq/1_0/SPM_KPI_HSEQALL_MAY2023.csv" recfm=n ;
input x $char1. @@;
file out recfm=s;
put x $char1. @@;
run;
Can you help me figure out if there’s something wrong with the code?
Thank you
the error is :
The folder or file doesn't exist.
If I delete the options -pw because my SAS administrator has installed the key on server , the error that I recieve is:
Error:
Couldn't read packet: Connection reset by peer
Hi resolved, there was a problem with key authoritazion.
the correct code:
filename out sftp "SPM_KPI_HSEQALL_MAY2023.csv" host='XXXXXXXXX' debug
cd='01_IMPORTED_KPI' user='XXXXXXXXX' optionsx='-i /home/aaa/.ssh/SPM_PVTK.ppk';
data _null_;
infile "/sasgrid/hseq/1_0/SPM_KPI_HSEQALL_MAY2023.csv" recfm=n ;
input x $char1. @@;
file out recfm=s;
put x $char1. @@;
run;
Than you
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.