<?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: A warning of missing the END of DO group in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398425#M3732</link>
    <description>&lt;P&gt;Post your full log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;included code shows 10 do's and 10 end's so the counts match, but I didn't read each line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I (SAS) formatted your code, which is what I usually do to try and find missing do/end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What type of SAS interface are you working with? In EG and Base there are keyboard shortcuts that allow you to jump from a Do to the corresponding END. I can't find a similar function in SAS Studio &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml ;
    load D;
    load RR;
    load LL;
    start LLH(st, fi, S);
    b_1=(S[st:(fi-1), 4]`)*S[(st+1):fi, 4]/((S[st:(fi-1), 4]`)*S[st:(fi-1), 4]);
    b_2s=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4];
    b_2=b_2s[:];
    sigma_s1=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4]-b_2;
    sigma_s2=sigma_s1##J((fi-st), 1, 2);
    sigma=(fi-st-1)/(fi-st-2)*sigma_s2[:];

    if sigma=0 then
        LLF=.;
    else
        do;
            LLF=(-0.5*(fi-st-1))*log(2*arcos(-1)*sigma)-1/(2*sigma)*((S[st:(fi-1), 
                4]`)*S[st:(fi-1), 4]);
        end;
    return(LLF);
    finish LLH;
    fname="split1":"split2320";

    do i=1 to ncol(fname);
        dsname="spl1." + strip(fname[i]);
        use (dsname);

        do t=1 to 120;
            g=D[t, 1];
            read all where(COL2=g) into SS;

            if nrow(SS)=0 then
                RR[i, t]=.;
            else
                do;
                    st=1;
                    fi=15;
                    M_sf=J(1, 2, 0);

                    do until (fi&amp;gt;240);

                        if abs(LLH(st, fi+1, SS)/LLH(st, fi, SS)-1)&amp;gt;0.1 then
                            do;
                                M_sf[1, 1]=st;
                                M_sf[1, 2]=fi;
                                stfi=stfi//M_sf;
                                st=fi+1;
                                fi=fi+15;

                                if st&amp;gt;225 then
                                    do;
                                        M_sf[1, 1]=st;
                                        M_sf[1, 2]=240;
                                        stfi=stfi//M_sf;
                                    end;
                                else
                                    do;
                                        fi=fi+1;

                                        if fi&amp;gt;240 then
                                            do;
                                                M_sf[1, 1]=st;
                                                M_sf[1, 2]=240;
                                                stfi=stfi//M_sf;
                                            end;
                                    end;
                            end;

                        do tt=1 to nrow(stfi);
                            b_1=(S[st:(fi-1), 4]`)*S[(st+1):fi, 4]/((S[st:(fi-1), 4]`)*S[st:(fi-1), 
                                4]);
                            b_2s=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4];
                            b_2=b_2s[:];
                            sigma_s1=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4]-b_2;
                            sigma_s2=sigma_s1##J((fi-st), 1, 2);
                            r_11=sigma_s2;
                            r_1=r_1+r_11;
                            r_22=((S[(st+1):fi, 4]-S[(st+1):fi, 4][:])`)*(S[(st+1):fi, 
                                4]-S[(st+1):fi, 4][:]);
                            r_2=r_2+r_22;
                        end;
                        RR[i, t]=r_1/r_2;
                    end;
                end;
            close;
        end;
        store RR;
        create ba.RR from RR;
        append from RR;
        quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2017 00:09:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-09-25T00:09:19Z</dc:date>
    <item>
      <title>A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398406#M3731</link>
      <description>&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sas shows me a waring that Do group statements were not executed due to missing END at the time of Quit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT although I have checked it for several times, I still cannot find the problem.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
load D;
load RR;
load LL;

start LLH(st,fi,S);
 b_1=(S[st:(fi-1),4]`)*S[(st+1):fi,4]/((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
 b_2s=S[(st+1):fi,4]-b_1*S[st:(fi-1),4];
 b_2=b_2s[:];
 sigma_s1=S[(st+1):fi,4]-b_1*S[st:(fi-1),4]-b_2;
 sigma_s2=sigma_s1##J((fi-st),1,2);
 sigma=(fi-st-1)/(fi-st-2)*sigma_s2[:];
 if sigma=0 then LLF=.;
  else do;
  LLF=(-0.5*(fi-st-1))*log(2*arcos(-1)*sigma)-1/(2*sigma)*((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
 end;
return(LLF);
finish LLH;

fname = "split1":"split2320";
do i = 1 to ncol(fname);
 dsname = "spl1." + strip(fname[i]);
 use (dsname);
 do t=1 to 120;
  g=D[t,1];
  read all where(COL2=g) into SS; 
  if nrow(SS)=0 then RR[i,t]=.;
   else do;
   st=1;
   fi=15;
   M_sf=J(1,2,0);
   do until (fi&amp;gt;240);
    if abs(LLH(st,fi+1,SS)/LLH(st,fi,SS)-1)&amp;gt;0.1 
     then do;
     M_sf[1,1]=st;
     M_sf[1,2]=fi;
     stfi=stfi//M_sf;
     st=fi+1;
     fi=fi+15;
     if st&amp;gt;225 
      then do;
      M_sf[1,1]=st;
      M_sf[1,2]=240;
      stfi=stfi//M_sf;
     end;
     else do;
     fi=fi+1;
     if fi&amp;gt;240 
      then do;
      M_sf[1,1]=st;
      M_sf[1,2]=240;
      stfi=stfi//M_sf;
     end;
    end;
   end; 
   do tt=1 to nrow(stfi);
    b_1=(S[st:(fi-1),4]`)*S[(st+1):fi,4]/((S[st:(fi-1),4]`)*S[st:(fi-1),4]);
    b_2s=S[(st+1):fi,4]-b_1*S[st:(fi-1),4];
    b_2=b_2s[:];
    sigma_s1=S[(st+1):fi,4]-b_1*S[st:(fi-1),4]-b_2;
    sigma_s2=sigma_s1##J((fi-st),1,2);
    r_11=sigma_s2;
    r_1=r_1+r_11;
    r_22=((S[(st+1):fi,4]-S[(st+1):fi,4][:])`)*(S[(st+1):fi,4]-S[(st+1):fi,4][:]);
    r_2=r_2+r_22;
   end;
   RR[i,t]=r_1/r_2;
  end;
 end;
 close;
end;

store RR;
create ba.RR from RR;
append from RR;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Sep 2017 18:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398406#M3731</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-09-24T18:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398425#M3732</link>
      <description>&lt;P&gt;Post your full log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;included code shows 10 do's and 10 end's so the counts match, but I didn't read each line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I (SAS) formatted your code, which is what I usually do to try and find missing do/end.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What type of SAS interface are you working with? In EG and Base there are keyboard shortcuts that allow you to jump from a Do to the corresponding END. I can't find a similar function in SAS Studio &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml ;
    load D;
    load RR;
    load LL;
    start LLH(st, fi, S);
    b_1=(S[st:(fi-1), 4]`)*S[(st+1):fi, 4]/((S[st:(fi-1), 4]`)*S[st:(fi-1), 4]);
    b_2s=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4];
    b_2=b_2s[:];
    sigma_s1=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4]-b_2;
    sigma_s2=sigma_s1##J((fi-st), 1, 2);
    sigma=(fi-st-1)/(fi-st-2)*sigma_s2[:];

    if sigma=0 then
        LLF=.;
    else
        do;
            LLF=(-0.5*(fi-st-1))*log(2*arcos(-1)*sigma)-1/(2*sigma)*((S[st:(fi-1), 
                4]`)*S[st:(fi-1), 4]);
        end;
    return(LLF);
    finish LLH;
    fname="split1":"split2320";

    do i=1 to ncol(fname);
        dsname="spl1." + strip(fname[i]);
        use (dsname);

        do t=1 to 120;
            g=D[t, 1];
            read all where(COL2=g) into SS;

            if nrow(SS)=0 then
                RR[i, t]=.;
            else
                do;
                    st=1;
                    fi=15;
                    M_sf=J(1, 2, 0);

                    do until (fi&amp;gt;240);

                        if abs(LLH(st, fi+1, SS)/LLH(st, fi, SS)-1)&amp;gt;0.1 then
                            do;
                                M_sf[1, 1]=st;
                                M_sf[1, 2]=fi;
                                stfi=stfi//M_sf;
                                st=fi+1;
                                fi=fi+15;

                                if st&amp;gt;225 then
                                    do;
                                        M_sf[1, 1]=st;
                                        M_sf[1, 2]=240;
                                        stfi=stfi//M_sf;
                                    end;
                                else
                                    do;
                                        fi=fi+1;

                                        if fi&amp;gt;240 then
                                            do;
                                                M_sf[1, 1]=st;
                                                M_sf[1, 2]=240;
                                                stfi=stfi//M_sf;
                                            end;
                                    end;
                            end;

                        do tt=1 to nrow(stfi);
                            b_1=(S[st:(fi-1), 4]`)*S[(st+1):fi, 4]/((S[st:(fi-1), 4]`)*S[st:(fi-1), 
                                4]);
                            b_2s=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4];
                            b_2=b_2s[:];
                            sigma_s1=S[(st+1):fi, 4]-b_1*S[st:(fi-1), 4]-b_2;
                            sigma_s2=sigma_s1##J((fi-st), 1, 2);
                            r_11=sigma_s2;
                            r_1=r_1+r_11;
                            r_22=((S[(st+1):fi, 4]-S[(st+1):fi, 4][:])`)*(S[(st+1):fi, 
                                4]-S[(st+1):fi, 4][:]);
                            r_2=r_2+r_22;
                        end;
                        RR[i, t]=r_1/r_2;
                    end;
                end;
            close;
        end;
        store RR;
        create ba.RR from RR;
        append from RR;
        quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 00:09:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398425#M3732</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-25T00:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398426#M3733</link>
      <description>&lt;P&gt;It looks like there is not an END statement for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do i=1 to ncol(fname);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put an END either before the STORE statement or before the QUIT, depending upon&amp;nbsp;the logic of your program.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 00:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398426#M3733</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-09-25T00:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398528#M3734</link>
      <description>&lt;P&gt;the full log is shown as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.......(same as the code)&lt;/P&gt;&lt;P&gt;WARNING: DO group statements were not executed due to missing END at the time of QUIT.&lt;/P&gt;&lt;P&gt;121 &amp;nbsp;quit;&lt;/P&gt;&lt;P&gt;NOTE: Exiting IML.&lt;/P&gt;&lt;P&gt;NOTE: Storage library WORK.IMLSTOR closed.&lt;/P&gt;&lt;P&gt;NOTE: “PROCEDURE IML”: &amp;nbsp;&lt;/P&gt;&lt;P&gt;real time &amp;nbsp;0.47&lt;/P&gt;&lt;P&gt;cpu time 0.07&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the base of SAS interface, and what is the keyboard shortcuts for the corresponding END of the DO group?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 13:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/398528#M3734</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-09-25T13:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399216#M3735</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you got the keyboard shortcuts for finding the END corresponding to the DO group, which is mentioned by Reeza?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399216#M3735</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-09-27T15:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399227#M3736</link>
      <description>&lt;P&gt;See &lt;A href="https://blogs.sas.com/content/sasdummy/2013/10/29/five-keyboard-shortcuts/" target="_self"&gt;Chris's blog on keyboard shortcuts.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 15:30:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399227#M3736</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-09-27T15:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: A warning of missing the END of DO group</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399551#M3737</link>
      <description>&lt;P&gt;Hi Rick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that some problem still exists. The shortcut cannot lead to the right END with its corresponding DO group. Show you some example as below:&lt;/P&gt;&lt;P&gt;I start the shortcut at line 4, and sas jumps to line 9(wrong). I don't know why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
k=0;
t=0;
do f=1 to 3; /*start the shortcut here*/
if k=0 
then do;
k=k+1;
t=t+1;
end; /*but move to this wrong place*/
else do;
k=k+2;
t=t+2;
end;
end; 
print k t;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 17:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/A-warning-of-missing-the-END-of-DO-group/m-p/399551#M3737</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-09-28T17:02:32Z</dc:date>
    </item>
  </channel>
</rss>

