<?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: %goto error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205382#M38196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still don't understand what you are actually trying to achieve. Hopefully below code sample can give you some guidance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro projekt_schleife(bereich,bereich_druck,vb,ebene);&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "bereich&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;amp;bereich";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "bereich_druck='&amp;amp;bereich_druck'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "vb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ='&amp;amp;vb'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "ebene&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;amp;ebene";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro project(top_x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze1 = 100000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze2 = 30000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze3 = 5000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %eval(&amp;amp;top_x&amp;lt;25) %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %projekt_schleife(P0,P0,P,vb0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %projekt_schleife(P1,P1,1,vb1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%project(30);&lt;/P&gt;&lt;P&gt;%project(10);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2015 20:01:59 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2015-04-28T20:01:59Z</dc:date>
    <item>
      <title>%goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205375#M38189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm editing a SAS program with %macro/%mend funkction. For this macro I will make some loop´s. If Loop 1 is finished go to Loop 2 aso.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the report I have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;STRONG style="mso-fareast-language: DE; color: navy; background: white; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; projekt_schleife();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;*Code 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;/*&lt;BR /&gt;################################################################################################################&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: green; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;/* Uebersicht&amp;nbsp;&amp;nbsp; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;create table work.uebersicht as&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out.stand,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;out.&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;&amp;amp;ebene,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;out.position,&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(out.aktuell_kumuliert_gj) format=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;commax16.2&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; as aktuell_kumuliert_gj,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(out.aktuell_kumuliert_vj) format=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;commax16.2&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; as aktuell_kumuliert_vj,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(out.aktuell_kumuliert_vvj) format=&lt;/SPAN&gt;&lt;SPAN style="background: white; color: teal; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;commax16.2&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; as aktuell_kumuliert_vvj,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;sum(out.vormonat_gj)format=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;commax16.2&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; as vormonat_gj,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;&amp;nbsp;&amp;nbsp; sum(out.vormonat_vj)format=&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;commax16.2&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; as vormonat_vj&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;from sasco2.output_bs_vbeitrag&lt;BR /&gt;as out &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;where &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: teal; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;out.&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;&amp;amp;ebene IN (&amp;amp;vb) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;group by &lt;/SPAN&gt;&lt;STRONG style="mso-fareast-language: DE; color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="mso-fareast-language: DE; color: teal; background: white; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;, &lt;/SPAN&gt;&lt;STRONG style="mso-fareast-language: DE; color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;This ist the Code for the Loops. I Need the same request for every single Loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; top_x = 25;&lt;/SPAN&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; grenze1 = 100000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; grenze2 = 30000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; grenze3 = 5000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt; &lt;SPAN lang="EN-US" style="background: white; color: green; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;/******************Loop 1******************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%Goto&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; | &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%Go&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; to label1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%label1: &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; bereich = P0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; bereich_druck = 'P0';&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; vb ='P'; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; ebene =vb0;&lt;/SPAN&gt; &lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%&lt;STRONG&gt;&lt;EM&gt;projekt_schleife&lt;/EM&gt;&lt;/STRONG&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: green; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;/******************Loop 2******************/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left" style="text-align: left;"&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%Goto&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; | &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: blue; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt;%Go&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="background: white; color: black; font-family: 'Courier New'; mso-ansi-language: EN-US; mso-fareast-language: DE;"&gt; to label2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%label2:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; bereich = P1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; bereich_druck= 'P1';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; vb ='1';&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt; ebene = vb1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;%&lt;STRONG&gt;&lt;EM&gt;projekt_schleife&lt;/EM&gt;&lt;/STRONG&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background: white; color: black; font-family: 'Courier New'; mso-fareast-language: DE;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The error message is indicating that&amp;nbsp; "The %GOTO statement is not valid in open code." and "Statement is not valid or it is used out of proper order."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what does this mean and how can I edit above to work?&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks for any and all assistance. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 09:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205375#M38189</guid>
      <dc:creator>yakamoz</dc:creator>
      <dc:date>2015-04-28T09:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205376#M38190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks to me as if you've copied code snippets from some other program and now try to paste these together and "make it work". It would be better you first try to write the actual logic in simple SAS code and then "macrotize" it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So first thing which is currently missing: A %mend; statement which finishes the macro definition. You also shouldn't call macro &lt;SPAN style="line-height: 1.5em; color: #000000; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 13px; font-family: 'Courier New'; color: #000000;"&gt;&lt;STRONG style="font-family: inherit; font-weight: inherit;"&gt;&lt;EM&gt;projekt_schleife&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; color: #000000; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; within it's own macro definition unless you like never ending loops.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The open code error means that you're trying to use a macro statement outside of a macro definition.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 12:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205376#M38190</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-28T12:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205377#M38191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh you´re right I forgot to write&amp;nbsp; &lt;SPAN style="color: #000000; line-height: 1.5em; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="color: #000000; line-height: 1.5em; font-family: 'Courier New'; font-size: 13px;"&gt;&lt;STRONG style="font-family: inherit; font-weight: inherit;"&gt;&lt;EM&gt;projekt_schleife&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; line-height: 1.5em; font-family: 'Courier New'; font-size: 13px; background-color: #ffffff;"&gt;()&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; at the end in this post. But it doesn´t work with this correct Code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thats means, I have to put the %macro code together with the %goto-Code? I will get the same Error. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; There is something wrong with the %goto macro&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 12:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205377#M38191</guid>
      <dc:creator>yakamoz</dc:creator>
      <dc:date>2015-04-28T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205378#M38192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For a single Loop the code is running but I can´t compare 2 Loops....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 12:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205378#M38192</guid>
      <dc:creator>yakamoz</dc:creator>
      <dc:date>2015-04-28T12:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205379#M38193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Patrick, there are various issues in the code and it doesn't make sense.&amp;nbsp; Also I don't see that this code is actually doing anything.&amp;nbsp; Start by describing what you are trying to do, post a datastep with some test data, and required output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205379#M38193</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-28T13:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205380#M38194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax for a %GOTO statement is just %goto label; .&amp;nbsp; Why do you have pipe characters in the middle of your %GOTO statements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you planning to call the macro recursively?&amp;nbsp; If so make sure that it exits without calling itself again.&amp;nbsp; I do not see any conditional statements in your macro that would prevent it from getting into an infinitely nested recursive loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not then you will need another macro to be able to use %GOTO statement. You cannot use it in open code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205380#M38194</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-28T13:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205381#M38195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For SAS to consider this open code, it is likely that the mistake is earlier.&amp;nbsp; There is likely some sort of unfinished comment statement before this code appears, which also comments out the %macro project_schleife statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 13:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205381#M38195</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-04-28T13:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205382#M38196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still don't understand what you are actually trying to achieve. Hopefully below code sample can give you some guidance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro projekt_schleife(bereich,bereich_druck,vb,ebene);&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "bereich&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;amp;bereich";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "bereich_druck='&amp;amp;bereich_druck'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "vb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ='&amp;amp;vb'";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put "ebene&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;amp;ebene";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro project(top_x);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze1 = 100000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze2 = 30000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let grenze3 = 5000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %if %eval(&amp;amp;top_x&amp;lt;25) %then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %projekt_schleife(P0,P0,P,vb0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %projekt_schleife(P1,P1,1,vb1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%project(30);&lt;/P&gt;&lt;P&gt;%project(10);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2015 20:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205382#M38196</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-28T20:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: %goto error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205383#M38197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all for your answer. I din´t put all issues from the code in this post because it´s too much data. Is it possible to send the hole code per E-Mail. I don´t want to present it online. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 12:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/goto-error/m-p/205383#M38197</guid>
      <dc:creator>yakamoz</dc:creator>
      <dc:date>2015-04-30T12:37:42Z</dc:date>
    </item>
  </channel>
</rss>

