マクロ変数を作成し、その変数に値を割り当てます。
種類: | マクロステートメント |
制限事項: | マクロ定義またはオープンコードで使用可能 |
参照項目: | %STR関数と%NRSTR関数 |
%macro title(text,number); %put TITLE&number "&text"; %mend; %let topic= The History of Genetics ; /* Leading and trailing */ /* blanks are removed */ %title(&topic,1) %let subject=topic; /* &subject resolves */ %let &subject=Genetics Today; /* before assignment */ %title(&topic,2) %let subject=The Future of Genetics; /* &subject resolves */ %let topic= &subject; /* before assignment */ %title(&topic,3)
13 %macro title(text,number); 14 %put TITLE&number "&text"; 15 %mend; 16 %let topic= The History of Genetics ; 17 18 %title(&topic,1) TITLE1 "The History of Genetics" 19 %let subject=topic; 20 %let &subject=Genetics Today; 21 %title(&topic,2) TITLE2 "Genetics Today" 22 %let subject=The Future of Genetics; 23 %let topic= &subject; 24 %title(&topic,3) TITLE3 "The Future of Genetics"