Hi all,
Can any body help me to understand how it will executes
%let one=two;
%let two=three;
%let three=Check;
%put &one;
%put &&one;
%put &&&one;
%put &&&&one;
%put &&&&&one;
%put &&&&&&one;
%put &&&&&&&one;
%put &&&&&&&&one;
%put &&&&&&&&&one;
%put &&&&&&&&&&one;
what is the differnce between &,&& and &&&
How can i understand this concept.
Thanks &Regards
Rawindarreddy
In addition to Peter's (excellent) suggestion, searching on the forum would reveal this previous forum posting:
https://communities.sas.com/message/12344#12344 that discusses the forward scan rule and the rescan rule of macro variables (which are the topics you should search for in the documentation). In addition, turning on the system option SYMBOLGEN will help you see the trace of macro variable resolution (including how multiple ampersands are resolved) in the SAS Log. Also, there have been some user group papers on how to approach the resolution of multiple ampersands, such as these two -- there are more if you search:
http://www2.sas.com/proceedings/sugi29/063-29.pdf
http://www2.sas.com/proceedings/sugi22/CODERS/PAPER77.PDF
Also, for a beginner's introduction to macro processing in general, I recommend this paper:
http://www2.sas.com/proceedings/sugi28/056-28.pdf
cynthia
the macro manual is available on-line at http://support.sas.com/documentation
In addition to Peter's (excellent) suggestion, searching on the forum would reveal this previous forum posting:
https://communities.sas.com/message/12344#12344 that discusses the forward scan rule and the rescan rule of macro variables (which are the topics you should search for in the documentation). In addition, turning on the system option SYMBOLGEN will help you see the trace of macro variable resolution (including how multiple ampersands are resolved) in the SAS Log. Also, there have been some user group papers on how to approach the resolution of multiple ampersands, such as these two -- there are more if you search:
http://www2.sas.com/proceedings/sugi29/063-29.pdf
http://www2.sas.com/proceedings/sugi22/CODERS/PAPER77.PDF
Also, for a beginner's introduction to macro processing in general, I recommend this paper:
http://www2.sas.com/proceedings/sugi28/056-28.pdf
cynthia
thank......u Cynthia.I got it
And, after you've read everything that Peter and Cynthia suggested, try running the following expanded version of your code and see if you can predict what the various resulting values will be:
%let Check=four;
%let one=two;
%let two=three;
%let three=Check;
%let four=five;
%let five=six;
%put &one;
%put &&one;
%put &&&one;
%put &&&&one;
%put &&&&&one;
%put &&&&&&one;
%put &&&&&&&one;
%put &&&&&&&&one;
%put &&&&&&&&&one;
%put &&&&&&&&&&one;
%put &&&&&&&&&&&one;
%put &&&&&&&&&&&&one;
%put &&&&&&&&&&&&&one;
%put &&&&&&&&&&&&&&one;
%put &&&&&&&&&&&&&&&one;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.