<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: call symput, symget, resolve - which one to use? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45312#M9365</link>
    <description>Thanks!&lt;BR /&gt;
The problem was solved perfectly.</description>
    <pubDate>Tue, 07 Dec 2010 15:49:26 GMT</pubDate>
    <dc:creator>Lucas</dc:creator>
    <dc:date>2010-12-07T15:49:26Z</dc:date>
    <item>
      <title>call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45295#M9348</link>
      <description>Hi,&lt;BR /&gt;
I have a DataSet with column col_EXP, which contains date expression, e.g:&lt;BR /&gt;
&lt;BR /&gt;
DATA test;&lt;BR /&gt;
 col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
 col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
Now, I would like to create a new column col_DT with computed date from expression in column col_EXP. &lt;BR /&gt;
&lt;BR /&gt;
data test2;&lt;BR /&gt;
 set test;&lt;BR /&gt;
 col_DT = ????;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I have tried with call symput, symget and resolve funcions but without any success:(&lt;BR /&gt;
Can anyone help me?</description>
      <pubDate>Mon, 06 Dec 2010 13:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45295#M9348</guid>
      <dc:creator>Lucas</dc:creator>
      <dc:date>2010-12-06T13:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45296#M9349</link>
      <description>Lucas,&lt;BR /&gt;
&lt;BR /&gt;
There has GOT to be a less convoluted way than the one I'll propose but, if this is something that you HAVE to get done, the following might provide what you need:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DATA test;&lt;BR /&gt;
  length col_EXP $50;&lt;BR /&gt;
  col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
  col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
filename ft17f001 temp; &lt;BR /&gt;
data _null_; &lt;BR /&gt;
   file ft17f001;&lt;BR /&gt;
   set test end=lastone;&lt;BR /&gt;
   if _n_ eq 1 then do;&lt;BR /&gt;
     put 'data test2;'; &lt;BR /&gt;
     put +3 'format col_DT date9.;';&lt;BR /&gt;
   end; &lt;BR /&gt;
   put +3 'col_DT=' col_EXP ';'; &lt;BR /&gt;
   put +3 'output;'; &lt;BR /&gt;
   if lastone then put 'Run;'; &lt;BR /&gt;
run; &lt;BR /&gt;
%inc ft17f001 / source2; &lt;BR /&gt;
&lt;BR /&gt;
data test2;&lt;BR /&gt;
  set test;&lt;BR /&gt;
  set test2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Mon, 06 Dec 2010 17:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45296#M9349</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-12-06T17:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45297#M9350</link>
      <description>Hello Lucas,&lt;BR /&gt;
&lt;BR /&gt;
I am not quite sure why you use this approach. Could you explain your goal in more detail? Anyway, this can be achieved with macro variables like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA _null_t;&lt;BR /&gt;
  %let col_EXP1=intnx('day',today(),2);&lt;BR /&gt;
  %let col_EXP2=intnx('day',today(),10);&lt;BR /&gt;
RUN;&lt;BR /&gt;
data Result;&lt;BR /&gt;
  col_DT = &amp;amp;col_EXP1; ouput;&lt;BR /&gt;
  col_DT = &amp;amp;col_EXP2; ouput;&lt;BR /&gt;
  format col_DT date7.;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
I do not think it is what you need. This is why I' like to know more details.&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 06 Dec 2010 18:01:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45297#M9350</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-12-06T18:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45298#M9351</link>
      <description>Here is an alternative macro solution, although no less convoluted.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA test;&lt;BR /&gt;
length col_EXP $50;&lt;BR /&gt;
col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
	select count(*) into: num_expressions&lt;BR /&gt;
	from test;&lt;BR /&gt;
&lt;BR /&gt;
	%let num_expressions = &amp;amp;num_expressions;&lt;BR /&gt;
&lt;BR /&gt;
	select col_EXP into :col_EXP1-:col_EXP&amp;amp;num_expressions&lt;BR /&gt;
	from test;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
%macro test;&lt;BR /&gt;
	%do i = 1 %to &amp;amp;num_expressions;&lt;BR /&gt;
	col_EXP ="&amp;amp;&amp;amp;&amp;amp;col_exp&amp;amp;i";&lt;BR /&gt;
	col_DT = &amp;amp;&amp;amp;&amp;amp;col_exp&amp;amp;i;&lt;BR /&gt;
	output;&lt;BR /&gt;
	%end;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
data test1;&lt;BR /&gt;
	%test&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 06 Dec 2010 20:54:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45298#M9351</guid>
      <dc:creator>polingjw</dc:creator>
      <dc:date>2010-12-06T20:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45299#M9352</link>
      <description>Hi,&lt;BR /&gt;
thank you all for a quick response! Sorry for my english &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
@art2897&lt;BR /&gt;
Thanks! I wrote something similar to your program. Tommorow I will try to paste my code.  It works fine but as you said it is quite complex. How works 'put +3' statement in your code? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
@SPR &lt;BR /&gt;
The expression must be define in a permanent DataSet. Based on this expression a newcolumn col_DT is computed. I hope I explained problem more precisely.&lt;BR /&gt;
&lt;BR /&gt;
@polingjw&lt;BR /&gt;
yeah:) your macro is convoluted. Great exercise to practise macro variables &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;
&lt;BR /&gt;
================================&lt;BR /&gt;
Let's try to find a solution in one DataStep! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I have tried something like this (in many many combinations :/):&lt;BR /&gt;
&lt;BR /&gt;
DATA test;&lt;BR /&gt;
 col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
 col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA test2;&lt;BR /&gt;
 set test;&lt;BR /&gt;
 call symput ('col_EXP_DT', col_EXP); &lt;BR /&gt;
 col_DT = symget('col_EXP_DT');&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
But unfortunately symget does not resolved the expression &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Mon, 06 Dec 2010 23:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45299#M9352</guid>
      <dc:creator>Lucas</dc:creator>
      <dc:date>2010-12-06T23:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45300#M9353</link>
      <description>Hi:&lt;BR /&gt;
  About this code:&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA test2;&lt;BR /&gt;
  set test;&lt;BR /&gt;
  call symput ('col_EXP_DT', col_EXP); &lt;BR /&gt;
  col_DT = symget('col_EXP_DT');&lt;BR /&gt;
RUN;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
You cannot both create and use a macro variable within 1 DATA step program. That means if you create &amp;amp;col_EXP_DT in a DATA step program, that a step boundary must be encountered before you USE &amp;amp;col_EXT_DT in a program.&lt;BR /&gt;
 &lt;BR /&gt;
See this Tech Support note (and the Macro Facility documentation) for more details:&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/23/182.html" target="_blank"&gt;http://support.sas.com/kb/23/182.html&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 07 Dec 2010 02:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45300#M9353</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-07T02:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45301#M9354</link>
      <description>There is another problem.&lt;BR /&gt;
You need assign long enough space for variable col_EXP.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA test;&lt;BR /&gt;
&lt;B&gt;length col_EXP $ 100;&lt;/B&gt;&lt;BR /&gt;
col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA test2;&lt;BR /&gt;
set test;&lt;BR /&gt;
call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
col_DT = symget('col_EXP_DT');&lt;BR /&gt;
RUN;&lt;BR /&gt;
%put _user_;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Dec 2010 03:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45301#M9354</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-07T03:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45302#M9355</link>
      <description>Aside that this does not work the way you want, again we ask what are you trying to do?&lt;BR /&gt;
&lt;BR /&gt;
If you want to create a new variable then no macro variables are needed.&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA test;&lt;BR /&gt;
col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA test2;&lt;BR /&gt;
set test;&lt;BR /&gt;
col_DT = col_exp;&lt;BR /&gt;
RUN;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
But even this does not make any sense.</description>
      <pubDate>Tue, 07 Dec 2010 03:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45302#M9355</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-12-07T03:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45303#M9356</link>
      <description>What about the invalid argument message with your code? cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
492&lt;BR /&gt;
493  DATA test2;&lt;BR /&gt;
494  set test;&lt;BR /&gt;
495  call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
496  col_DT = symget('col_EXP_DT');&lt;BR /&gt;
497  RUN;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Invalid argument to function SYMGET at line 496 column 10.&lt;BR /&gt;
col_EXP=intnx('day',today(),2) col_DT=  _ERROR_=1 _N_=1&lt;BR /&gt;
NOTE: Invalid argument to function SYMGET at line 496 column 10.&lt;BR /&gt;
col_EXP=intnx('day',today(),10) col_DT=  _ERROR_=1 _N_=2&lt;BR /&gt;
NOTE: There were 2 observations read from the data set&lt;BR /&gt;
      WORK.TEST.&lt;BR /&gt;
NOTE: The data set WORK.TEST2 has 2 observations and 2&lt;BR /&gt;
      variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.14 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 07 Dec 2010 03:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45303#M9356</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-07T03:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45304#M9357</link>
      <description>Cynthia.&lt;BR /&gt;
I have not received these NOTEs.&lt;BR /&gt;
I am using SAS 9.2 TS1M0 for Windows.&lt;BR /&gt;
The following is my LOG.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
132&lt;BR /&gt;
133  DATA test2;&lt;BR /&gt;
134  set test;&lt;BR /&gt;
135  call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
136  col_DT = symget('col_EXP_DT');&lt;BR /&gt;
137  RUN;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 2 observations read from the data set WORK.TEST.&lt;BR /&gt;
NOTE: The data set WORK.TEST2 has 2 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.27 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
138  %put _user_;&lt;BR /&gt;
GLOBAL COL_EXP_DT intnx('day',today(),2)&lt;BR /&gt;
GLOBAL COL_EXP_DT1 intnx('day',today(),2)&lt;BR /&gt;
GLOBAL COL_EXP_DT2 intnx('day',today(),10)&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Dec 2010 06:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45304#M9357</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-07T06:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45305#M9358</link>
      <description>How did you get &amp;amp;COL_EXP_DT (without a number) in your global symbol table?? You appended _N_ to the macro variable name in the CALL SYMPUT statement in your program. That should have created ONLY &amp;amp;COL_EXP_DT1 and &amp;amp;COL_EXP_DT2.&lt;BR /&gt;
 &lt;BR /&gt;
If &amp;amp;COL_EXP_DT (without a number) does not exist, then you will get the invalid argument message. I suspect the reason you're not seeing the message is that in some previous test run you actually created &amp;amp;COL_EXP_DT.&lt;BR /&gt;
&lt;BR /&gt;
But really, it's a moot point about the message, because I believe the original poster did NOT just want to see the text string with the INTNX function, I think he actually wanted to have the INTNX function execute. And, I agree with ArtC and other responders who have indicated that what is being shown 1) doesn't make sense and 2) probably doesn't require a macro variable.&lt;BR /&gt;
 &lt;BR /&gt;
I just don't think a lot of time needs to be spent coming up with more variations to do something that is not well-explained on data that is not fully understandable. If we understood a bit more about the real data and the real scenario and the actual task to be accomplished, someone might have a useful suggestion.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 07 Dec 2010 07:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45305#M9358</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-07T07:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45306#M9359</link>
      <description>Cynthia.&lt;BR /&gt;
&amp;amp;COL_EXP_DT (without a number) is actually from OP's code and I revise it,then got this curious result.&lt;BR /&gt;
And I receive these notes as yours.&lt;BR /&gt;
When I close SAS session and re-run the code,the following is LOG.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
6&lt;BR /&gt;
7    DATA test2;&lt;BR /&gt;
8    set test;&lt;BR /&gt;
9    call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
10   col_DT = symget('col_EXP_DT');&lt;BR /&gt;
11   RUN;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Invalid argument to function SYMGET at line 10 column 10.&lt;BR /&gt;
col_EXP=intnx('day',today(),2) col_DT=  _ERROR_=1 _N_=1&lt;BR /&gt;
NOTE: Invalid argument to function SYMGET at line 10 column 10.&lt;BR /&gt;
col_EXP=intnx('day',today(),10) col_DT=  _ERROR_=1 _N_=2&lt;BR /&gt;
NOTE: There were 2 observations read from the data set WORK.TEST.&lt;BR /&gt;
NOTE: The data set WORK.TEST2 has 2 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.22 seconds&lt;BR /&gt;
      cpu time            0.05 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
12   %put _user_;&lt;BR /&gt;
GLOBAL COL_EXP_DT1 intnx('day',today(),2)&lt;BR /&gt;
GLOBAL COL_EXP_DT2 intnx('day',today(),10)&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
and maybe change it a little more.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA test2;&lt;BR /&gt;
set test;&lt;BR /&gt;
call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
&lt;B&gt;col_DT = symget(cats('col_EXP_DT',_n_));&lt;/B&gt;&lt;BR /&gt;
RUN;&lt;BR /&gt;
%put _user_;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
then These notes will not appear again.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
18&lt;BR /&gt;
19   DATA test2;&lt;BR /&gt;
20   set test;&lt;BR /&gt;
21   call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
22   col_DT = symget(cats('col_EXP_DT',_n_));&lt;BR /&gt;
23   RUN;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 2 observations read from the data set WORK.TEST.&lt;BR /&gt;
NOTE: The data set WORK.TEST2 has 2 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.05 seconds&lt;BR /&gt;
      cpu time            0.02 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
24   %put _user_;&lt;BR /&gt;
GLOBAL COL_EXP_DT1 intnx('day',today(),2)&lt;BR /&gt;
GLOBAL COL_EXP_DT2 intnx('day',today(),10)&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 07 Dec 2010 07:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45306#M9359</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-07T07:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45307#M9360</link>
      <description>Macro statement can solve your problem.&lt;BR /&gt;
And I think 'call symput, symget, resolve' would not solve your problem,because you request to dynamic invoke Macro variables ,it is hard to achieve.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
DATA test;&lt;BR /&gt;
length col_EXP $ 100;&lt;BR /&gt;
col_EXP="intnx('day',today(),2)";output;&lt;BR /&gt;
col_EXP="intnx('day',today(),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA _null_;&lt;BR /&gt;
set test nobs=num_obs;&lt;BR /&gt;
call symput (cats('col_EXP_DT',_n_), col_EXP);&lt;BR /&gt;
call symput ('nobs',num_obs);&lt;BR /&gt;
RUN;&lt;BR /&gt;
%put _user_;&lt;BR /&gt;
&lt;BR /&gt;
%macro data;&lt;BR /&gt;
data test2;&lt;BR /&gt;
 set test;&lt;BR /&gt;
 if _n_ eq 1 then col_DT=&amp;amp;col_EXP_DT1;&lt;BR /&gt;
  %do i=2 %to &amp;amp;nobs;&lt;BR /&gt;
    else if _n_ eq &amp;amp;i then col_DT=&amp;amp;&amp;amp;col_EXP_DT&amp;amp;i ;&lt;BR /&gt;
  %end;&lt;BR /&gt;
 format col_DT yymmdd10.;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%data&lt;BR /&gt;
&lt;BR /&gt;
proc print;run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp

Message was edited by: Ksharp</description>
      <pubDate>Tue, 07 Dec 2010 08:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45307#M9360</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-12-07T08:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45308#M9361</link>
      <description>Hi all!&lt;BR /&gt;
&lt;BR /&gt;
Cynthia@sas 	&lt;BR /&gt;
&lt;BR /&gt;
Yes, I want to achieve exactly what you think. &lt;BR /&gt;
I don't just want to see the text string with the INTNX function in the new column, I want to have the INTNX function execute.&lt;BR /&gt;
&lt;BR /&gt;
Another words:&lt;BR /&gt;
&lt;BR /&gt;
If I have oryginal DataSet&lt;BR /&gt;
col_EXP;&lt;BR /&gt;
intnx('day',today(),2);	&lt;BR /&gt;
intnx('day',today(),10);&lt;BR /&gt;
&lt;BR /&gt;
I want to achieve this result:&lt;BR /&gt;
col_EXP;col_DT&lt;BR /&gt;
intnx('day',today(),2);	2010-12-09&lt;BR /&gt;
intnx('day',today(),10); 2010-12-17&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The solution of @art297, @polingjw and @Ksharp works fine. I was just wondered if it can be done in easier way. Now I know that there is no chance to make this in one datastep.</description>
      <pubDate>Tue, 07 Dec 2010 10:07:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45308#M9361</guid>
      <dc:creator>Lucas</dc:creator>
      <dc:date>2010-12-07T10:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45309#M9362</link>
      <description>Lucas,&lt;BR /&gt;
&lt;BR /&gt;
I posted your question on the SAS-L board and one if its members, Joe Matise, provided precisely what I think you were looking for.  Take a look at the following:&lt;BR /&gt;
&lt;BR /&gt;
DATA test;&lt;BR /&gt;
 length col_EXP $50;&lt;BR /&gt;
 col_EXP="intnx(day,%sysfunc(today()),2)";output;&lt;BR /&gt;
 col_EXP="intnx(day,%sysfunc(today()),10)";output;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data want;&lt;BR /&gt;
  set test;&lt;BR /&gt;
  format col_DT date9.;&lt;BR /&gt;
  col_DT = resolve('%sysfunc('||col_exp||')');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Also, you had asked me about the formatting of the put statements I had used in my original offering.  The +3 was simply indenting the line so that the file would be easier to read by humans.&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Tue, 07 Dec 2010 14:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45309#M9362</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-12-07T14:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45310#M9363</link>
      <description>art297,&lt;BR /&gt;
&lt;BR /&gt;
Yes, it is exactly what I was looking for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks a lot!&lt;BR /&gt;
&lt;BR /&gt;
P.S What is SAS-L board? I'm quite new in SAS...</description>
      <pubDate>Tue, 07 Dec 2010 15:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45310#M9363</guid>
      <dc:creator>Lucas</dc:creator>
      <dc:date>2010-12-07T15:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45311#M9364</link>
      <description>A description of SAS-L, and how to access it, can be found at:&lt;BR /&gt;
&lt;A href="http://www.sascommunity.org/wiki/SAS-L" target="_blank"&gt;http://www.sascommunity.org/wiki/SAS-L&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Art</description>
      <pubDate>Tue, 07 Dec 2010 15:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45311#M9364</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-12-07T15:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45312#M9365</link>
      <description>Thanks!&lt;BR /&gt;
The problem was solved perfectly.</description>
      <pubDate>Tue, 07 Dec 2010 15:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45312#M9365</guid>
      <dc:creator>Lucas</dc:creator>
      <dc:date>2010-12-07T15:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45313#M9366</link>
      <description>...&lt;BR /&gt;
&amp;gt; You cannot both create and use a macro variable within&lt;BR /&gt;
&amp;gt; 1 DATA step program. That means if you create&lt;BR /&gt;
&amp;gt; &amp;amp;col_EXP_DT in a DATA step program, that a step&lt;BR /&gt;
&amp;gt; boundary must be encountered before you USE&lt;BR /&gt;
&amp;gt; &amp;amp;col_EXT_DT in a program.&lt;BR /&gt;
&amp;gt;  &lt;BR /&gt;
&amp;gt; See this Tech Support note (and the Macro Facility&lt;BR /&gt;
&amp;gt; documentation) for more details:&lt;BR /&gt;
&amp;gt; &lt;A href="http://support.sas.com/kb/23/182.html" target="_blank"&gt;http://support.sas.com/kb/23/182.html&lt;/A&gt;&lt;BR /&gt;
...&lt;BR /&gt;
I guess the note is not 100% clear if even a long time user ends up drawing a wrong conclusion like that. You definitely *can* both create and use a macro variable within a data step.&lt;BR /&gt;
[pre]&lt;BR /&gt;
   %symdel mvar;&lt;BR /&gt;
   data _null_;&lt;BR /&gt;
     call symput('mvar', 'what');&lt;BR /&gt;
     something = resolve('&amp;amp;mvar');&lt;BR /&gt;
     put something=;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* on log&lt;BR /&gt;
   something=what&lt;BR /&gt;
   */&lt;BR /&gt;
[/pre]

Message was edited by: chang_y_chung@hotmail.com</description>
      <pubDate>Tue, 07 Dec 2010 19:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45313#M9366</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-12-07T19:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: call symput, symget, resolve - which one to use?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45314#M9367</link>
      <description>The posted TS Note says that:&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
You cannot use a &lt;U&gt;macro variable reference&lt;/U&gt; to retrieve the value of a macro variable &lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
What they mean is a "simple" &amp;amp;macvar form of reference. There are other techniques, as you have shown. But the most common issue is trying to use a simple &amp;amp;macvar in the same step where it is created.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 07 Dec 2010 20:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-symput-symget-resolve-which-one-to-use/m-p/45314#M9367</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-12-07T20:26:37Z</dc:date>
    </item>
  </channel>
</rss>

