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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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: