Desktop productivity for business analysts and programmers

file transfer using x commands to mask macro varibales

Reply
New Contributor
Posts: 2

file transfer using x commands to mask macro varibales

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?

 

 

 

Super User
Posts: 10,589

Re: file transfer using x commands to mask macro varibales

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 2

Re: file transfer using x commands to mask macro varibales

Posted in reply to KurtBremser

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

Super User
Posts: 10,589

Re: file transfer using x commands to mask macro varibales

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 6,935

Re: file transfer using x commands to mask macro varibales

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.

Ask a Question
Discussion stats
  • 4 replies
  • 130 views
  • 2 likes
  • 3 in conversation