<?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: Syntax check which has link statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504009#M134815</link>
    <description>&lt;P&gt;If you honestly and sincerely wrote this code which one may agree considering your proc star status, nonetheless your question raises doubt whether you really wrote the code. On the other hand, supposing you did, what's the problem in checking syntax by yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With reference to many of your previous questions, I'm afraid the legitimacy of your questions seem very doubtful&lt;/P&gt;</description>
    <pubDate>Sat, 13 Oct 2018 15:11:39 GMT</pubDate>
    <dc:creator>Allaluiah</dc:creator>
    <dc:date>2018-10-13T15:11:39Z</dc:date>
    <item>
      <title>Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504008#M134814</link>
      <description>&lt;P&gt;Appreciate if someone of you validate whether the following code respect to the SAS syntax? Since I do not have access to SAS enviornment at the moment I'm unable to validate it. As&amp;nbsp;the following code has link statement, I'm not sure that the code which I updated is valid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 05:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504008#M134814</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-19T05:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504009#M134815</link>
      <description>&lt;P&gt;If you honestly and sincerely wrote this code which one may agree considering your proc star status, nonetheless your question raises doubt whether you really wrote the code. On the other hand, supposing you did, what's the problem in checking syntax by yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With reference to many of your previous questions, I'm afraid the legitimacy of your questions seem very doubtful&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504009#M134815</guid>
      <dc:creator>Allaluiah</dc:creator>
      <dc:date>2018-10-13T15:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504010#M134816</link>
      <description>&lt;P&gt;I've updated the code and not written the full code which was in OP. I have updated the same in OP.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504010#M134816</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-13T15:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504012#M134818</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/48036"&gt;@Allaluiah&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;If you honestly and sincerely wrote this code which one may agree considering your proc star status, nonetheless your question raises doubt whether you really wrote the code. On the other hand, supposing you did, what's the problem in checking syntax by yourself.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With reference to many of your previous questions, I'm afraid the legitimacy of your questions seem very doubtful&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/48036"&gt;@Allaluiah&lt;/a&gt;&amp;nbsp;if your criticism of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;is in regards to use of the LINK statement I suggest you are mistaken.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504012#M134818</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-13T15:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504014#M134819</link>
      <description>&lt;P&gt;I don't see any problems with your use of LINK.&amp;nbsp; I even use GOTO and all the kids think GOTO is taboo.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a couple of things&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   schrijfh:

         *schrijf weg met huidige gegevens;
         p2kbrn='7';

         if substr(khiref,1,1)  = '1' then
            do;
               file outfr14a noprint notitles; *File statement use redundand as FT14OUTH has file statement;
               link fr14outh;
            end;

         if substr(khiref,1,1)  = '2' then
            do;
               file outfr14b noprint notitles; *same redundand;
               link fr14outh;
            end;
         else if substr(khiref,1,1)  = '0' then
            do;
               file outfr14 noprint notitles; *same again;
               link fr14outh;
            end;

         return;
         fr14outh :   
            file '$FSAGDU/data/transport/out/qis_dwh/QISFR10_c.txt' lrecl=64;
         put @1   khiref   $20
            @21  kndbtpDB $10
            @31  knkbty   $2.
            @33  knkatv   $2.
            @35  knkath   $2.
            @37  knabew   3. 
            @40  psi      9. 
            @49  gnksec   $9.
            @58  agi      6. 
         ;
         output;  *remove you are using DATA _NULL_;
         return;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I've commented about in the code here.&amp;nbsp; I think you have an unclosed DO block I'll see if I can figure that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504014#M134819</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-13T15:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504015#M134820</link>
      <description>&lt;P&gt;I hope your future sake that you really don't update production code if you don't validate the logic yourself.&lt;/P&gt;&lt;P&gt;basic debuggers help to identify issues.&amp;nbsp; At times you can learn what the prior programmer was intending to do by stepping a few records through the logic.&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/use-of-index/m-p/264460#M51865" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/use-of-index/m-p/264460#M51865&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:44:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504015#M134820</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-13T15:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504018#M134822</link>
      <description>&lt;P&gt;Good morning Guru &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;, Doesn't Goto 's return take you to the next iteration of the datastep as opposed to the link return?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am i missing something in my understanding&amp;gt;?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504018#M134822</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-13T15:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504021#M134824</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Good morning Guru &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__&lt;/a&gt;, Doesn't Goto 's return take you to the next iteration of the datastep as opposed to the link return?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am i missing something in my understanding&amp;gt;?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;LINK is GOTO and RETURN to jump point.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GOTO is just jump.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the HEADER= option in the FILE statement is an implied LINK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the EOF= option in the INFILE statement is and implied GOTO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know if that helps. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 15:57:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504021#M134824</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-13T15:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504030#M134830</link>
      <description>Is that OK if I remove file statement before PUT which was in the last step?&lt;BR /&gt;</description>
      <pubDate>Sat, 13 Oct 2018 17:51:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504030#M134830</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-13T17:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504032#M134831</link>
      <description>&lt;P&gt;It is hard for me to read that hanging indentation style. For example you have indented lines after IF statements (so the structure implies you have added a DO block) but when I scan the left margin to find the corresponding END there is nothing before another statement starts on the same indentation as the IF.&amp;nbsp; That is not a problem per se, it just makes it harder to scan the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do have one instance that looks strange where if you have&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if substr(khiref,1,1)  = '1' then
if substr(khiref,1,1)  = '2' then
else if substr(khiref,1,1)  = '0' then&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since the value cannot be both '1' and '0' it is probably ok, but it looks strange to not have ELSE before the second IF in that construct.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Oct 2018 18:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504032#M134831</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-13T18:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504063#M134838</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You really should do the first pass of unit testing yourself. This would show you that there is an unclosed DO block (=missing end statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;          else knkbty='5';
          knkatv = '';
          knkath = '';
          link schrijfh;
        end;

      return;
      return;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;          else knkbty='5';
          knkatv = '';
          knkath = '';
          link schrijfh;
        end;

      end;
      return;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also below bit looks to me logically not right:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;        end;
      else if substr(khiref,1,1)  = '0' then
        do;
          file outfr14 noprint notitles;
          link fr14outh;
        end;

      return;
      fr14outh :   
        file '$FSAGDU/data/transport/out/qis_dwh/QISFR10_c.txt' lrecl=64;
      put @1   khiref   $20&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You have code like &lt;EM&gt;file outfr14 noprint notitles;&amp;nbsp;&lt;/EM&gt;in your code (I assume that there is somewhere a filename statement which defines this fileref). You then link directly to &lt;EM&gt;fr14out&lt;/EM&gt; where you issue another file statement - which will overwrite the previous file statement AND you always link to &lt;EM&gt;fr14out&lt;/EM&gt; from your if/then/else blocks meaning that always the same code writing to the same file will get executed - which renders your if/then/else rather useless as they always result in identical code being executed. &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 00:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504063#M134838</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-10-14T00:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504067#M134841</link>
      <description>I will try to add 'else' in the if clause. Is there any other which you&lt;BR /&gt;feel logically incorrect?&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Oct 2018 01:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504067#M134841</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-14T01:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax check which has link statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504068#M134842</link>
      <description>In order to correct the logical error, can I remove the file statement&lt;BR /&gt;which I placed before the PUT statement?&lt;BR /&gt;</description>
      <pubDate>Sun, 14 Oct 2018 01:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-check-which-has-link-statement/m-p/504068#M134842</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2018-10-14T01:17:13Z</dc:date>
    </item>
  </channel>
</rss>

