Hi,
Did you try to use the LS option coming with the SFTP method of FILENAME?
From the SAS® 9.4 Statements: Reference, Fifth Edition and its FILENAME Statement, SFTP Access Method chapter, we have:
Other options such as LSFILE, etc. might help you too.
From that same page, you'll also have access to Exemple 4: Reading Files from a Directory on the Remote Host.
This can be done after you retrieved the file name:
This example reads the files test.dat and test2.dat from a directory on the remote host.
filename infile sftp '/users/xxxx/' host="unixhost1" dir;
data _null_;
infile infile(test.dat) truncover;
input a $25.;
infile infile(test2.dat) truncover;
input b $25.;
run;
Hope that helps.
(Sorry I can't test, i don't have a SFTP available).
Cheers, Damo
... View more