Hi,
I need to connect to FTP with different port. Can you help on it?
Please help us all out. Go back and edit your post to have a meaningful title that actually describes the problem. A title of "SAS" could apply to every post here, and so should not be used. A post named SAS makes the SAS Communities less useful to everyone.
We are going to need more information. What tool are you using? The FTP libname engine has a PORT option that I know works.
We will need to see some code. This error looks like you are getting an FTP manual page. I doubt you will be able to change the port without getting into the code of that macro you are using.
This is an old approach to using FTP in SAS. I would recommend you look into the FTP libname engine.
That said, this code is generating an script for an FTP client, shelling out, and executing the FTP command with that script.
I am pretty sure you don't want the port in this line. It should stay on the open statement where you already have it. I think you also don't want the host in that line either since you have an open command in the script.
filename doftp pipe "ftp -n -s:&ftpcmds &host1 &port"; /* FTP Command File */
Try this instead.
filename doftp pipe "ftp -n -s:&ftpcmds "; /* FTP Command File */
You should see the FTP dialog in your SAS log window. It should help you figure out why.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.