BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Frede_1
Fluorite | Level 6

Hi

 

I have some issues using the syntax LSA in the SFTP procedure.

 

Untill now i have used the syntax below and it has worked fine.

 

filename local '***************************' LRECL = 2000;

 

filename SFTP SFTP '/'

DIR FILEEXT LSA

HOST = '***.**.***.**'

USER = '**********'

WAIT_MILLISECONDS = 5000

LRECL = 2000

OPTIONS = '-P ** -i \\*****.*** -pw "*******"'

DEBUG

 

I have manged to transfer files from the SFTP library SFTP to my own library local, using the following syntax.

data _null_;

infile SFTP ('&SFTP_FILE') truncover;

input;

file local (&LOCAL_FILE');

Put _infile_;

run;

 

But how do i use SAS to get an exact overview of all the files that are located in the library SFTP. I have read that i can use the LSA and LS syntax but I cant really get it to work.

 

Please help 🙂

 

Kind regards Frederik.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Frede_1
Fluorite | Level 6

I recieved the following solution from Bruno that works perfectly, thought I would share it:

 

Frederik

 

The follwoing code works for me. It will list all the files from the root directory to the SAS Log. You will need to adapt it to your needs.

 

filename xsas ftp cd="/" host="machine" user="myuser" pass="mypass" list debug; 

 

data _null_;

infile xsas;

input;

putlog _infile_;

run;

 

Please send also the log

View solution in original post

1 REPLY 1
Frede_1
Fluorite | Level 6

I recieved the following solution from Bruno that works perfectly, thought I would share it:

 

Frederik

 

The follwoing code works for me. It will list all the files from the root directory to the SAS Log. You will need to adapt it to your needs.

 

filename xsas ftp cd="/" host="machine" user="myuser" pass="mypass" list debug; 

 

data _null_;

infile xsas;

input;

putlog _infile_;

run;

 

Please send also the log

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 1023 views
  • 0 likes
  • 1 in conversation