<?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>Thema "Do-Schleife - Lösung gesucht" in CoDe SAS German</title>
    <link>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209710#M123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Liebe SAS-Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ich sitze gerade vor einem SAS-"Problem" und bin auf der Suche nach einer guten Lösungen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ich arbeite mit einem Panel-Datensatz der bisher Variablen zu den Jahren 2001 bis 2008 beinhaltet hat. Alle Variablen sind mit dem Präfix vj01 bis vj08 versehen. Viele Stellen in meinem Codeberg greifen auf DO-Schleifen zurück, da sich der Code sich zwischen den Jahren 2001 bis 2008 bis auf das Präfix der Variablen häufig nicht ändert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Die DO-Schleifen habe ich bisher wie folgt erstellt:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do i=1 %to 8 %by 1;&lt;/P&gt;&lt;P&gt;vj0&amp;amp;i.VARx = vj0&amp;amp;i.VARy + vj0&amp;amp;i.VARz;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nun habe ich einen neuen Datensatz der zusätzlich die Jahre 2009 und 2010 enthält. Für 2010 ist der obige Code nicht zu gebrauchen, da "vj0&amp;amp;i" für 2010 nicht "vj10" sondern "vj010" erzeugt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mein bisheriger Lösungsansatz sieht wie folgt aus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do i=1 %to 10 %by 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;i = 1&amp;nbsp;&amp;nbsp;&amp;nbsp; %then&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let vj = vj01;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;%if&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;i = 10&amp;nbsp;&amp;nbsp;&amp;nbsp; %then&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let vj = vj10;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;vj.VARx = &amp;amp;vj.VARy + &amp;amp;vj.VARz;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hat jemand von euch vielleicht eine bessere Idee?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viele Grüße&lt;/P&gt;&lt;P&gt;Swen Kuper&lt;/P&gt;&lt;DIV id="gmBFhv" style="display: none ! important; visibility: hidden ! important; position: absolute ! important; height: auto ! important; width: auto; z-index: 1410065406 ! important; border: 1px solid #0043b3 ! important; vertical-align: middle ! important; padding: 1px ! important; margin: 0px ! important; color: #000000 ! important; background-color: #ffffcc ! important; font-family: Arial ! important; font-size: 12px ! important; line-height: normal ! important; font-weight: normal ! important; left: 246px ! important; top: 575px ! important;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Mar 2015 08:48:39 GMT</pubDate>
    <dc:creator>Swen</dc:creator>
    <dc:date>2015-03-25T08:48:39Z</dc:date>
    <item>
      <title>Do-Schleife - Lösung gesucht</title>
      <link>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209710#M123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Liebe SAS-Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ich sitze gerade vor einem SAS-"Problem" und bin auf der Suche nach einer guten Lösungen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ich arbeite mit einem Panel-Datensatz der bisher Variablen zu den Jahren 2001 bis 2008 beinhaltet hat. Alle Variablen sind mit dem Präfix vj01 bis vj08 versehen. Viele Stellen in meinem Codeberg greifen auf DO-Schleifen zurück, da sich der Code sich zwischen den Jahren 2001 bis 2008 bis auf das Präfix der Variablen häufig nicht ändert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Die DO-Schleifen habe ich bisher wie folgt erstellt:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do i=1 %to 8 %by 1;&lt;/P&gt;&lt;P&gt;vj0&amp;amp;i.VARx = vj0&amp;amp;i.VARy + vj0&amp;amp;i.VARz;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nun habe ich einen neuen Datensatz der zusätzlich die Jahre 2009 und 2010 enthält. Für 2010 ist der obige Code nicht zu gebrauchen, da "vj0&amp;amp;i" für 2010 nicht "vj10" sondern "vj010" erzeugt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mein bisheriger Lösungsansatz sieht wie folgt aus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do i=1 %to 10 %by 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;i = 1&amp;nbsp;&amp;nbsp;&amp;nbsp; %then&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let vj = vj01;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;%if&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;i = 10&amp;nbsp;&amp;nbsp;&amp;nbsp; %then&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let vj = vj10;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;vj.VARx = &amp;amp;vj.VARy + &amp;amp;vj.VARz;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hat jemand von euch vielleicht eine bessere Idee?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Viele Grüße&lt;/P&gt;&lt;P&gt;Swen Kuper&lt;/P&gt;&lt;DIV id="gmBFhv" style="display: none ! important; visibility: hidden ! important; position: absolute ! important; height: auto ! important; width: auto; z-index: 1410065406 ! important; border: 1px solid #0043b3 ! important; vertical-align: middle ! important; padding: 1px ! important; margin: 0px ! important; color: #000000 ! important; background-color: #ffffcc ! important; font-family: Arial ! important; font-size: 12px ! important; line-height: normal ! important; font-weight: normal ! important; left: 246px ! important; top: 575px ! important;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 08:48:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209710#M123</guid>
      <dc:creator>Swen</dc:creator>
      <dc:date>2015-03-25T08:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Do-Schleife - Lösung gesucht</title>
      <link>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209711#M124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ich nehme an der folgende code spricht fuer sich selbst:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %local y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i=1 %to 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let y=%sysfunc(putc(&amp;amp;i,z2.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put vj&amp;amp;y.VARx = vj&amp;amp;y.VARy + vj&amp;amp;y.VARz;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 10:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209711#M124</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-03-25T10:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Do-Schleife - Lösung gesucht</title>
      <link>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209712#M125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;danke für die Idee. Damit werde ich etwas herumprobieren.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Grüße&lt;/P&gt;&lt;P&gt;Swen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 13:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/CoDe-SAS-German/Do-Schleife-L%C3%B6sung-gesucht/m-p/209712#M125</guid>
      <dc:creator>Swen</dc:creator>
      <dc:date>2015-03-25T13:54:21Z</dc:date>
    </item>
  </channel>
</rss>

