<?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: why couldn't create a macro var in the data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59454#M12883</link>
    <description>I would suspect of a "weird" character somewhere in your source code.&lt;BR /&gt;
&lt;BR /&gt;
Try to type the same code into a new source and run it.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
    <pubDate>Fri, 19 Feb 2010 15:46:20 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2010-02-19T15:46:20Z</dc:date>
    <item>
      <title>why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59448#M12877</link>
      <description>Hi&lt;BR /&gt;
 According to my below coding. It doesn' t create macro var numrec. but if I place 'put numrec' instead of 'call symput('num', numrec)' it output the value 5; Please note that I  am using version 8.2. thanks so much in advance for your help.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
input x 1.;&lt;BR /&gt;
cards;&lt;BR /&gt;
1&lt;BR /&gt;
2&lt;BR /&gt;
3&lt;BR /&gt;
4&lt;BR /&gt;
5&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
call symput('numrec', numrec);&lt;BR /&gt;
stop;&lt;BR /&gt;
set temp nobs=numrec;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%put 'value  '  &amp;amp;numrec;&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Inp</description>
      <pubDate>Thu, 18 Feb 2010 15:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59448#M12877</guid>
      <dc:creator>Inp</dc:creator>
      <dc:date>2010-02-18T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59449#M12878</link>
      <description>It works for me (v9.1.3 SP4)&lt;BR /&gt;
[pre]&lt;BR /&gt;
NOTE: SAS initialization used:&lt;BR /&gt;
      real time           16.67 seconds&lt;BR /&gt;
      cpu time            1.48 seconds&lt;BR /&gt;
&lt;BR /&gt;
1    data temp;&lt;BR /&gt;
2    input x 1.;&lt;BR /&gt;
3    cards;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The data set WORK.TEMP has 5 observations and 1 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           1.54 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
9    ;&lt;BR /&gt;
10   run;&lt;BR /&gt;
11&lt;BR /&gt;
12&lt;BR /&gt;
13   data _null_;&lt;BR /&gt;
14   call symput('numrec', numrec);&lt;BR /&gt;
15   stop;&lt;BR /&gt;
16   set temp nobs=numrec;&lt;BR /&gt;
17   run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;
      14:23&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.25 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
18&lt;BR /&gt;
19   %put 'value ' &amp;amp;numrec;&lt;BR /&gt;
'value '            5&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Thu, 18 Feb 2010 15:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59449#M12878</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2010-02-18T15:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59450#M12879</link>
      <description>your code worked for me and created the macro variable successfully with a value of 5[pre]446  %put 'value ' &amp;amp;numrec;&lt;BR /&gt;
'value '            5[/pre]&lt;BR /&gt;
but perhaps that's because I'm running SAS9.2&lt;BR /&gt;
 &lt;BR /&gt;
Why are you running such an old version of SAS?&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 18 Feb 2010 15:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59450#M12879</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-02-18T15:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59451#M12880</link>
      <description>It worked for SAS 9.2  which I have on my  pc But my maiframe has SAS 8.2. &lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
Inp</description>
      <pubDate>Thu, 18 Feb 2010 16:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59451#M12880</guid>
      <dc:creator>Inp</dc:creator>
      <dc:date>2010-02-18T16:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59452#M12881</link>
      <description>it might help reveal the issues if you could post the sas log from the mainframe run of the program</description>
      <pubDate>Thu, 18 Feb 2010 17:19:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59452#M12881</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-02-18T17:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59453#M12882</link>
      <description>12         DATA _NULL_;&lt;BR /&gt;
13         CALL SYMPUT('NUMREC', NUMREC);&lt;BR /&gt;
                                 ______&lt;BR /&gt;
                                 ______&lt;BR /&gt;
                                 ______&lt;BR /&gt;
                                 546&lt;BR /&gt;
                                 546&lt;BR /&gt;
                                 546&lt;BR /&gt;
NOTE 546-185: THE VARIABLE NUMREC MAY BE UNINITIALIZED.&lt;BR /&gt;
&lt;BR /&gt;
14         STOP;&lt;BR /&gt;
15         SET TEMP NOBS=NUMREC;&lt;BR /&gt;
16         RUN;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: NUMERIC VALUES HAVE BEEN CONVERTED TO CHARACTER VALUES AT THE PLACES GIVEN BY: (LINE):(COLUMN).&lt;BR /&gt;
      13:23&lt;BR /&gt;
NOTE: THE DATA STATEMENT USED 0.00 CPU SECONDS AND 8620K.</description>
      <pubDate>Fri, 19 Feb 2010 15:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59453#M12882</guid>
      <dc:creator>Inp</dc:creator>
      <dc:date>2010-02-19T15:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59454#M12883</link>
      <description>I would suspect of a "weird" character somewhere in your source code.&lt;BR /&gt;
&lt;BR /&gt;
Try to type the same code into a new source and run it.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Fri, 19 Feb 2010 15:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59454#M12883</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2010-02-19T15:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59455#M12884</link>
      <description>Suggest you share *ALL* of the SAS log from your mainframe batch job.  And include a %PUT _ALL_;  to dump all user SAS macro variables declared.&lt;BR /&gt;
&lt;BR /&gt;
And consider that the message you received is a SAS NOTE, not an ERROR.&lt;BR /&gt;
&lt;BR /&gt;
And, you definitely want to get up on a supported SAS version on z/OS (IBM mainframe), either SAS 9.2 Phase 2 (recommended) or at least SAS 9.1.3 SP4 (plus HOTFIXes).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 19 Feb 2010 16:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59455#M12884</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-02-19T16:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: why couldn't create a macro var in the data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59456#M12885</link>
      <description>could it be a feature of SAS82 : not populating the NOBS= variable until the SET statement is executed, rather than compiled?</description>
      <pubDate>Fri, 19 Feb 2010 16:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-couldn-t-create-a-macro-var-in-the-data-step/m-p/59456#M12885</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-02-19T16:28:53Z</dc:date>
    </item>
  </channel>
</rss>

