<?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: SAS HELP in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74371#M21562</link>
    <description>I would not recommend using macros if you don't have to.  The macro variable discussion / documentation occurs within the SAS Macro Language discussion though.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Tue, 06 Oct 2009 18:44:20 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-10-06T18:44:20Z</dc:date>
    <item>
      <title>SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74363#M21554</link>
      <description>Hi i am using sas and need help on construction a new URN. I currently have a URN field which is populated with 1_1urn, 1_2urn, 1_3urn etc..now everytime the code is run i need the urn to increment by 1..so the next time it is run the urn is 2_1urn, 2_2urn, 2_3urn and if run again 3_1urn, 3_2urn etc..any ideas..i am having trouble storing the incremented value. At the moment iv got&lt;BR /&gt;
&lt;BR /&gt;
urn = 1&lt;BR /&gt;
urn = urn + 1&lt;BR /&gt;
&lt;BR /&gt;
everytime this is run it read the 1 i need a way to store the new urn value and so it doesnt read the 1...Do i need to create another table?? Also is there a easier way of doing this in DI studio?</description>
      <pubDate>Mon, 05 Oct 2009 17:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74363#M21554</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2009-10-05T17:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74364#M21555</link>
      <description>You could create a permanent table; read it and update with each execution and store back the new "incremented" value.  You would need to consider possibly how to deal with reruns - not sure about your requirement?&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 05 Oct 2009 19:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74364#M21555</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-05T19:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74365#M21556</link>
      <description>Sorry i don't understand what you mean...I have data which i get regular new loads and so i need to update the load number automatically from 1, 2, 3 etc. I then append this in to the URN. I just ned a way of updating 1 to 2 and then 2 to 3 everytime the code is submited</description>
      <pubDate>Mon, 05 Oct 2009 20:22:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74365#M21556</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2009-10-05T20:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74366#M21557</link>
      <description>Your idea of tracking a "current load number" across runs could be maintained as a permanent SAS dataset (you must create it in advance and prime it to start), which you process each time your program runs, as follows:&lt;BR /&gt;
&lt;BR /&gt;
1) Using a DATA step, read the SAS file that has your variable to track the current "load number", and issue a CALL SYMPUT to assign a SAS macro variable with +1 from your "load number" variable.&lt;BR /&gt;
&lt;BR /&gt;
2) Use the macro variable created in #1 above to update your database variable(s) as required.&lt;BR /&gt;
&lt;BR /&gt;
3) When processing is finished, store back the new "current load number" into your permanent SAS dataset.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 05 Oct 2009 22:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74366#M21557</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-05T22:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74367#M21558</link>
      <description>Ok so i have created a dataset which had a looks like this&lt;BR /&gt;
&lt;BR /&gt;
ID&lt;BR /&gt;
1&lt;BR /&gt;
&lt;BR /&gt;
I have looked at the CALL SYMPUT in the help files and have tried to implement it but cant get it right...also how would i store the current load number back?</description>
      <pubDate>Tue, 06 Oct 2009 17:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74367#M21558</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2009-10-06T17:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74368#M21559</link>
      <description>Please share what SAS code you have executing which doesn't provide the SYMPUT correctly, preferably in an executed SAS log  (COPY/PASTE into a post-reply).  &lt;BR /&gt;
&lt;BR /&gt;
Also, for your own debugging, consider using the SAS command(s) below to display your user-assigned macro variables -- and there are considerations for GLOBAL versus LOCAL macro variables depending on whether or not you are using the SAS MACRO language:&lt;BR /&gt;
&lt;BR /&gt;
%PUT _USER_;&lt;BR /&gt;
...or...&lt;BR /&gt;
%PUT _LOCAL_;&lt;BR /&gt;
%PUT _GLOBAL_;&lt;BR /&gt;
&lt;BR /&gt;
And for diagnosing your SAS program, you will want to activate as much SAS-generate compilation/processing output directed to your SAS log, using the command:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MACROGEN /* SYMBOLGEN */ MPRINT;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
And, you would use the macro variable from the SYMPUT to assign the ID variable a new/replacement value in a DATA step, writing back to your permanent SAS data library member used for tracking.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
SAS Macro Language: Reference - Scope of Macro Variables:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002047080.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Macro Language: Reference - Introduction to the Macro Facility&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002293969.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a002293969.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS Macro Programming for Beginners&lt;BR /&gt;
Susan J. Slaughter, Avocet Solutions, Davis, CA&lt;BR /&gt;
Lora D. Delwiche, Delwiche Consulting, Winters, CA&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi29/243-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/243-29.pdf&lt;/A&gt;</description>
      <pubDate>Tue, 06 Oct 2009 17:43:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74368#M21559</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-06T17:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74369#M21560</link>
      <description>Ok, i have now fixed sas code i have just been playing around with the SYMPUT function..being new to SAS i havent fully got my head around macros...</description>
      <pubDate>Tue, 06 Oct 2009 18:11:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74369#M21560</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2009-10-06T18:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74370#M21561</link>
      <description>Sorry i ment...&lt;BR /&gt;
Ok, i have no fixed sas code i have just been playing around with the SYMPUT function..being new to SAS i havent fully got my head around macros...</description>
      <pubDate>Tue, 06 Oct 2009 18:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74370#M21561</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2009-10-06T18:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74371#M21562</link>
      <description>I would not recommend using macros if you don't have to.  The macro variable discussion / documentation occurs within the SAS Macro Language discussion though.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 06 Oct 2009 18:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74371#M21562</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-06T18:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS HELP</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74372#M21563</link>
      <description>Very quick and dirty:  But it may give you a starting point.&lt;BR /&gt;
&lt;BR /&gt;
data urn;&lt;BR /&gt;
u = 1;&lt;BR /&gt;
output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data two;&lt;BR /&gt;
do i = 3 to 7;&lt;BR /&gt;
output;&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data three urn(keep = u) ;&lt;BR /&gt;
retain urn;&lt;BR /&gt;
merge  two(in = t) end = eof urn;&lt;BR /&gt;
if _n_ = 1 then urn = u;&lt;BR /&gt;
urn = urn + 1;&lt;BR /&gt;
&lt;BR /&gt;
if t then output three;&lt;BR /&gt;
if eof then do u = urn; output urn; end;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 06 Oct 2009 19:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-HELP/m-p/74372#M21563</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-10-06T19:21:38Z</dc:date>
    </item>
  </channel>
</rss>

