BookmarkSubscribeRSS Feed
Patrick
Opal | Level 21

Is your SAS server OS Windows or Unix/Linux? 

Right now you're using a Windows DIR command with a Unix path....

Patrick_0-1703762191120.png

Your log shows that macro variable &fn1 doesn't exist and because you're using it as part of a path the path won't be valid even after you fix the rest of the path.

Patrick_1-1703762313365.png

Not sure why you're creating all these macro variables &fn<n> given that you later on only try to use &fn1 ...which obviously doesn't get created.

Patrick_2-1703762674338.png

If you really need all these macro variables then replace this incomplete list of IF statements with code like below.

Patrick_3-1703762720354.png

....but first you need to get your logic right.

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 16 replies
  • 25202 views
  • 1 like
  • 8 in conversation