BookmarkSubscribeRSS Feed
harsham
Calcite | Level 5

Hi  All,

 

I have a scenario as mentioned below

 

OS UNIX

 

source= /sas/basesas/avancedsas/advancedsas & basesas/abc.xls

 

destination=/one/two/three

 

I need to do a file transfer in sas eg 5.1 using x commands from source to destination.

 

Kindly suggest how to mask " & " values  while performing FTP using  X commands?

 

 

 

4 REPLIES 4
Kurt_Bremser
Super User

Using "&" in a pathname in a UNIX system is REALLY BAD, as the & character has very special meaning to the operating system.

Name your path like this:

/sas/basesas/avancedsas/advancedsas_and_basesas

and all your problems vanish in a puff of logic smoke.

 

See Maxim 44 and Maxim 15.

harsham
Calcite | Level 5

No it's not possible to make a change, please let me know in case of any alternatives

Kurt_Bremser
Super User

It's always possible to correct a mistake. In this case, the mistake is so egregious that making the change is not only possible, but mandatory.

Keeping that & in the pathname along with the blanks is an exercise in stupidity.

Astounding
PROC Star

The X command expects the command itself to be in quotes.  If you use single quotes instead of double quotes, that automatically masks all macro references.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1221 views
  • 2 likes
  • 3 in conversation