<?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: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800512#M314937</link>
    <description>&lt;P&gt;Read your code and read the log.&lt;/P&gt;
&lt;P&gt;If you look not so closely at the highlighted code below you will see that one of the characters is numeral for one, the other is a letter , lower case L. So unless you have a numeric variable named L that has a value inside the valid range for the array using that part of the loop, it starts i with an invalid value. If you do not have a variable L the first value of I is missing. 1 l&amp;nbsp; 0 O&amp;nbsp; , one L, zero capital O are two ancient and common coding problems.&lt;/P&gt;
&lt;PRE&gt;data diet6;
set diet6;
array dbp  dbp0 dbp7 dbp20;
array sbp  sbp0 sbp7 sbp20;
array  htn htn0 htn7 htn20;
do i=&lt;FONT size="6" color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; to dim(dbp);
if dbp(i)ge 90 and sbp(i) ge 140 then htn(i)= "1";
else htn(i)= "0";
end;
array weightkg weightkg0 weightkg7 weightkg20;
array heightm  heightm0 heightm7  heightm20;
array bmi bmi0 bmi7 bmi20;
do i=&lt;FONT size="6" color="#FF0000"&gt;&lt;STRONG&gt;l&lt;/STRONG&gt;&lt;/FONT&gt; to dim(weightkg);
bmi(i)= (weightkg(i))/(heightm(i))**2;
end;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;</description>
    <pubDate>Sun, 06 Mar 2022 23:16:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-03-06T23:16:50Z</dc:date>
    <item>
      <title>Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop control</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800437#M314873</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;When I try to run the array below, the following message appears in my log:&lt;FONT color="#FF0000"&gt;&amp;nbsp;NOTE: Variable l is uninitialized.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;BY expression is missing, zero, or invalid.&amp;nbsp;&lt;FONT color="#000000"&gt;However, I can't figure out what is wrong with the code. Thank you all in advance for your help!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data diet6;
set diet6;
array dbp  dbp0 dbp7 dbp20;
array sbp  sbp0 sbp7 sbp20;
array  htn htn0 htn7 htn20;
do i=1 to dim(dbp);
if dbp(i)ge 90 and sbp(i) ge 140 then htn(i)= "1";
else htn(i)= "0";
end;
array weightkg weightkg0 weightkg7 weightkg20;
array heightm  heightm0 heightm7  heightm20;
array bmi bmi0 bmi7 bmi20;
do i=l to dim(weightkg);
bmi(i)= (weightkg(i))/(heightm(i))**2;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 07:16:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800437#M314873</guid>
      <dc:creator>zaldarsa</dc:creator>
      <dc:date>2022-03-06T07:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800438#M314874</link>
      <description>&lt;P&gt;Please post the&amp;nbsp;&lt;EM&gt;complete&lt;/EM&gt; log of this step.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 07:30:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800438#M314874</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-06T07:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800439#M314875</link>
      <description>&lt;P&gt;Sure thing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;NOTE: Character values have been converted to numeric values at the places given by:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;(Line):(Column).&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;12:39 13:6&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;NOTE: Variable l is uninitialized.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;BY expression is missing, zero, or invalid.&lt;/FONT&gt;&lt;BR /&gt;CENTER=1 ID=100061300991 age0=20 RACE=4 SEX=1 age7=28 age20=42 age25=46 age30=51 education0=2&lt;BR /&gt;education7=2 income7=6 education20=2 income20=10 smoke0=2 smoke7=2 smoke20=2 pact0=351 pact7=322&lt;BR /&gt;pact20=462 heightcm0=187 weightlb0=182 wasitcm0=76.5 heightcm7=188.5 weightlb7=218 waistcm7=89.5&lt;BR /&gt;heightcm20=189.5 weightlb20=233 waistcm20=96.75 sbp0=109 dbp0=64 sbp7=120 dbp7=78 sbp20=173&lt;BR /&gt;dbp20=109 trig0=45 hdl0=54 ldl0=101 hdl7=56 ldl7=131 trig7=69 trig20=220 ldl20=132 hdl20=52&lt;BR /&gt;glucose0=82 glucose7=81.523838915 glucose20=117.98560569 A07MLALC=7.1571428571 D07MLALC=36.81&lt;BR /&gt;G07MLALC=22.495714286 flag25=0 flag30=1 monosat0=1.2866878692 monosat7=1.0806127574&lt;BR /&gt;monosat20=1.2572706935 ICV25=. totalbrain25=. gm25=. frontalgm25=. occipitalgm25=. parietalgm25=.&lt;BR /&gt;temporalgm25=. wm25=. frontalwm25=. occipitalwm25=. parietalwm25=. temporalwm25=. abnormalwm25=.&lt;BR /&gt;hippocampus25=. amygdala25=. entorarea25=. poscingyrus25=. precuneus25=. ICV30=1660242&lt;BR /&gt;totalbrain30=1255052 gm30=640126 frontalgm30=178869 occipitalgm30=70858 parietalgm30=89634&lt;BR /&gt;temporalgm30=96928 wm30=614926 frontalwm30=230461 occipitalwm30=60727 parietalwm30=118151&lt;BR /&gt;temporalwm30=131192 abnormalwm30=11057 hippocampus30=8137 amygdala30=2201 entorarea30=3348&lt;BR /&gt;poscingyrus30=8161 precuneus30=20197 anaprioriscorebl=60 dnaprioriscorebl=77 gnaprioriscorebl=73&lt;BR /&gt;diabetes0=0 diabetes7=0 diabetes20=0 ICOGEXDAT=07/16/2015 ICOGIVID=156 ICOGEYEGL=2 ICOGBREYEGL=2&lt;BR /&gt;ICOGHA=1 ICOGBHA=. ICOGCOLOR1=2 ICOGCOLOR2=2 ICOGCOLOR3=2 ICOGCOLOR4=2 ICOGSPEECH=1 ICOGTREMOR=1&lt;BR /&gt;ICOGMISSEXT=1 ICOGOTHER=1 ICOGSTART=12:17 ICOGSTARTAMPM=2 ICOGSTOP=12:53 ICOGSTOPAMPM=2 I87SCORE1=3&lt;BR /&gt;I87SCORE2=6 I87SCORE3=6 I87SCORE4=8 I87SCORE5=7 I87INTSCORE=3 I87SCORE6=7 I87COMPTM=12:27&lt;BR /&gt;I87SDELAMPM=2 I87LDELTIM=12:36 I87LLDELAMPM=2 I87TOTDEL=9 I87SCORE7=6 I88TOTSC=34 I89NERR1=0&lt;BR /&gt;I89NCORR1=40 I89TOTSEC1=22 I89NERR2=0 I89NCORR2=40 I89TOTSEC2=24 I89NERR3=1 I89NCORR3=39&lt;BR /&gt;I89TOTSEC3=68 I94VSEPT=4 I94NAMPT=3 I94DIGPT=1 I94LETPT=0 I94SER7PT=3 I94LANGPT=2 I94LAFLPT=1&lt;BR /&gt;I94ABSTPT=1 I94DELRECPT=0 I94ORIENTPT=5 I94MOCATOT=20 I95REALMTOT=7 I94FWORDVAL=11 I96ATOT=9&lt;BR /&gt;I96AWORDVAL=6 I96STOT=15 I96SWORDVAL=15 I97ANIMVAL=17 I87TRIAL1=2 I87TRIAL2=2 I87TRIAL3=2&lt;BR /&gt;I87TRIAL4=2 I87TRIAL5=2 I87INTTRIAL=2 I87TRIAL6=2 I88TEST=2 I89TEST1=2 I89TEST2=2 I89TEST3=2&lt;BR /&gt;I87DEL=2 IMOCATEST=2 IREALMTEST=2 ILETATEST=2 ILETSTEST=2 ICATTEST=2 ICOGPHYS=. ICOGVIS=.&lt;BR /&gt;ICOGHEAR=. ICOGCNREAD=. ICOGINST=. ICOGNCOP=. ICOGTESTERROR=. ICOGOTHERN=. icogstroop=45&lt;BR /&gt;icogravlt=6 icogcatflu=17 icogletflu=32 icogdsst=34 icogmoca=20 icogrealm=7 A06FRU_CITFRUIT=0.85&lt;BR /&gt;A06FRU_FRUEXCIT=0.91 A06FRU_AVOCA=0 A06VEG_DARKGREEN=0 A06VEG_DEEPYELLOW=0.03 A06VEG_TOMATO=0.31&lt;BR /&gt;A06VEG_WHITEPOTATO=0.21 A06VEG_OTHSTARCH=0.27 A06VEG_LEGU=2.37 A06VEG_OTHER=1.38 A06GRW_WL=0&lt;BR /&gt;A06GRW_BDWL=0.06 A06GRW_OTHBDWL=0 A06GRW_CRKWL=0 A06GRW_PTWL=0 A06GRW_RTENSWL=0 A06GRW_RTESWL=0&lt;BR /&gt;A06GRW_CAKWL=0 A06GRW_SNKWL=0 A06GRW_CHIPWL=0 A06MRF_BEEF=1.38 A06MRL_LNBEEF=1.78 A06MRF_VEAL=0&lt;BR /&gt;A06MRL_LVEAL=0 A06MRF_LAMB=0 A06MRL_LNLAMB=0 A06MRF_FHPORK=0.8 A06MRL_LNFHPORK=0 A06MCF_CURPORK=0.2&lt;BR /&gt;A06MCL_LNCURPORK=0 A06MPF_POULTRY=0 A06MPF_LNPOULTRY=0.58 A06MFF_FISH=0 A06MFL_LNFISH=1.18&lt;BR /&gt;A06MSL_SHELLFISH=0 A06MCF_COLDCUT=0.32 A06MCL_LNCOLDCUT=0 A06MOF_ORGAN=0 A06DMF_WHMILK=2&lt;BR /&gt;A06DMF_RTDWHMILK=0 A06DCF_FULLFATCHEESE=0.09 A06DYF_YOGURTSTWHFAT=0 A06DYF_YOGURTARTSTWHF=0&lt;BR /&gt;A06FCF_CREAM=0 A06FAF_BUTTERRG=0.21 A06BVE_BEER=0.28 A06BVE_CORDIAL=0 A06BVE_DISTLIQUOR=0&lt;BR /&gt;A06BVE_WINE=0 fruit0=1.76 veggie0=1.99 potato0=0.21 legume0=2.37 grains0=0.06 fish0=1.18&lt;BR /&gt;rmeat0=4.48 poultry0=0.58 dairy0=2.3 alcohol0=0.28 D06FRU_CITFRUIT=0.07 D06FRU_FRUEXCIT=0.19&lt;BR /&gt;D06FRU_AVOCA=0 D06VEG_DARKGREEN=0.62 D06VEG_DEEPYELLOW=0 D06VEG_TOMATO=0.18 D06VEG_WHITEPOTATO=0.95&lt;BR /&gt;D06VEG_OTHSTARCH=0.3 D06VEG_LEGU=0.21 D06VEG_OTHER=0.43 D06GRW_WL=0 D06GRW_BDWL=0 D06GRW_OTHBDWL=0&lt;BR /&gt;D06GRW_CRKWL=0 D06GRW_PTWL=0 D06GRW_RTENSWL=0 D06GRW_RTESWL=0 D06GRW_CAKWL=0 D06GRW_SNKWL=0&lt;BR /&gt;D06GRW_CHIPWL=0 D06MRF_BEEF=0.37 D06MRL_LNBEEF=1.37 D06MRF_VEAL=0 D06MRL_LVEAL=0 D06MRF_LAMB=0&lt;BR /&gt;D06MRL_LNLAMB=0 D06MRF_FHPORK=0.43 D06MRL_LNFHPORK=0 D06MCF_CURPORK=0.19 D06MCL_LNCURPORK=1.33&lt;BR /&gt;D06MPF_POULTRY=0 D06MPF_LNPOULTRY=0.71 D06MFF_FISH=0 D06MFL_LNFISH=1.06 D06MSL_SHELLFISH=0.09&lt;BR /&gt;D06MCF_COLDCUT=1.22 D06MCL_LNCOLDCUT=0 D06MOF_ORGAN=0 D06DMF_WHMILK=0 D06DMF_RTDWHMILK=0&lt;BR /&gt;D06DCF_FULLFATCHEESE=0.06 D06DYF_YOGURTSTWHFAT=0 D06DYF_YOGURTARTSTWHF=0 D06FCF_CREAM=0&lt;BR /&gt;D06FAF_BUTTERRG=1.79 D06BVE_BEER=1.35 D06BVE_CORDIAL=0 D06BVE_DISTLIQUOR=0 D06BVE_WINE=0&lt;BR /&gt;fruit7=0.26 veggie7=1.53 potato7=0.95 legume7=0.21 grains7=0 fish7=1.15 rmeat7=4.91 poultry7=0.71&lt;BR /&gt;dairy7=1.85 alcohol7=1.35 G06FRU_CITFRUIT=0 G06FRU_FRUEXCIT=4.27 G06FRU_AVOCA=0&lt;BR /&gt;G06VEG_DARKGREEN=0.33 G06VEG_DEEPYELLOW=0.01 G06VEG_TOMATO=0.19 G06VEG_WHITEPOTATO=0.1&lt;BR /&gt;G06VEG_OTHSTARCH=0.27 G06VEG_LEGU=0.05 G06VEG_OTHER=0.93 G06GRW_WL=0 G06GRW_BDWL=0 G06GRW_OTHBDWL=0&lt;BR /&gt;G06GRW_CRKWL=0 G06GRW_PTWL=0 G06GRW_RTENSWL=0 G06GRW_RTESWL=0 G06GRW_CAKWL=0 G06GRW_SNKWL=0&lt;BR /&gt;G06GRW_CHIPWL=0 G06MRF_BEEF=1.1 G06MRL_LNBEEF=0.2 G06MRF_VEAL=0 G06MRL_LVEAL=0 G06MRF_LAMB=0&lt;BR /&gt;G06MRL_LNLAMB=0 G06MRF_FHPORK=0.37 G06MRL_LNFHPORK=0 G06MCF_CURPORK=0.11 G06MCL_LNCURPORK=0&lt;BR /&gt;G06MPF_POULTRY=0.52 G06MPF_LNPOULTRY=0.96 G06MFF_FISH=0 G06MFL_LNFISH=0.49 G06MSL_SHELLFISH=0&lt;BR /&gt;G06MCF_COLDCUT=0.39 G06MCL_LNCOLDCUT=0.2 G06MOF_ORGAN=0 G06DMF_WHMILK=0 G06DMF_RTDWHMILK=0&lt;BR /&gt;G06DCF_FULLFATCHEESE=0.06 G06DYF_YOGURTSTWHFAT=0 G06DYF_YOGURTARTSTWHF=0 G06FCF_CREAM=0&lt;BR /&gt;G06FAF_BUTTERRG=0.16 G06BVE_BEER=1.02 G06BVE_CORDIAL=0 G06BVE_DISTLIQUOR=1 G06BVE_WINE=0&lt;BR /&gt;fruit20=4.27 veggie20=1.73 potato20=0.1 legume20=0.05 grains20=0 fish20=0.49 rmeat20=2.37&lt;BR /&gt;poultry20=1.48 dairy20=0.22 alcohol20=2.02 rveggie0=3 rveggie7=2 rveggie20=2 rfruit0=4 rfruit7=1&lt;BR /&gt;rfruit20=5 rpotato0=3 rpotato7=5 rpotato20=2 rgrains0=1 rgrains7=0 rgrains20=0 rfish0=4 rfish7=4&lt;BR /&gt;rfish20=3 rlegume0=5 rlegume7=4 rlegume20=2 rpoultry0=3 rpoultry7=2 rpoultry20=4 rdairy0=3&lt;BR /&gt;rdairy7=3 rdairy20=1 ralcohol0=3 ralcohol7=5 ralcohol20=5 r_rmeat0=4 r_rmeat7=5 r_rmeat20=3&lt;BR /&gt;rmonosat0=5 rmonosat7=3 rmonosat20=4 i=. new_rpoultry0=2 new_rpoultry7=3 new_rpoultry20=1&lt;BR /&gt;new_rdairy0=2 new_rdairy7=2 new_rdairy20=4 newr_rmeat0=1 newr_rmeat7=0 newr_rmeat20=2&lt;BR /&gt;new_rmonosat0=4 new_rmonosat7=2 new_rmonosat20=3 meddiet0=29 meddiet7=23 meddiet20=24&lt;BR /&gt;meddietavg=25.333333333 avgdbp=83.666666667 avgsbp=134 avgincome=8 avgtrig=111.33333333 avghdl=54&lt;BR /&gt;avgldl=364 avgglucose=93.836481535 avgpact=378.33333333 edu_max=2 smoke_max=2 diabetes_max=0&lt;BR /&gt;weightkg0=82.628 weightkg7=98.972 weightkg20=105.782 heightm0=1.87 heightm7=1.885 heightm20=1.895&lt;BR /&gt;_I_=. htn0=0 htn7=0 htn20=1 bmi0=. bmi7=. bmi20=. l=. _ERROR_=1 _N_=1&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;NOTE: There were 1 observations read from the data set WORK.DIET6.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: The data set WORK.DIET6 may be incomplete. When this step was stopped there were 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;observations and 439 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Data set WORK.DIET6 was not replaced because this step was stopped.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;real time 0.13 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;cpu time 0.12 seconds&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 07:45:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800439#M314875</guid>
      <dc:creator>zaldarsa</dc:creator>
      <dc:date>2022-03-06T07:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800445#M314881</link>
      <description>&lt;P&gt;COMPLETE means including all code for that step. Only then can we (for instance) see the lines mentioned in the NOTE.&lt;/P&gt;
&lt;P&gt;And always use this button for posting logs:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 13:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800445#M314881</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-06T13:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800450#M314886</link>
      <description>&lt;P&gt;Your array definitions are improper.&amp;nbsp; They use a form of the ARRAY statement that was discontinued over 30 years ago.&amp;nbsp; (It is still supported, but is not compatible with the way you reference array elements later in the DATA step.)&amp;nbsp; For example, you use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array dbp  dbp0 dbp7 dbp20;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Instead, you should add the number of elements in the array:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array dbp  (3) dbp0 dbp7 dbp20;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, if you don't want to count the elements but intend to use the DIM function as you have, you could use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array dbp  (*) dbp0 dbp7 dbp20;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is difficult to envision why the old style would generate the errors you encountered.&amp;nbsp; Still, fix the known issue first, and see what errors remain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a side note, these variables get assigned values of "0" or "1":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array  htn (3) htn0 htn7 htn20;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If those variables are existing character variables, that is fine.&amp;nbsp; But if they don't already exist before the DATA step begins, they will be defined as numeric.&amp;nbsp; If they should be numeric, just remove the quotes (0 or 1, not "0" or "1").&amp;nbsp; If they are new, and should be created as character variables with a length of 1, indicate that in the ARRAY statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array  htn (3) $ 1 htn0 htn7 htn20;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 Mar 2022 10:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800450#M314886</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-03-06T10:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800483#M314918</link>
      <description>&lt;PRE class="language-sas"&gt;&lt;CODE&gt;do i=l to dim(weightkg);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Change i=l to i=1. One not letter l.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 17:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800483#M314918</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2022-03-06T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800487#M314921</link>
      <description>&lt;P&gt;That is not an issue in a DATA step.&amp;nbsp; The dimension of the array does not need to be specified, not even by adding the unnecessary [*] fluff.&amp;nbsp; There are some PROCs that support data step like code that do require it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There must be something else going on.&amp;nbsp; Like the DO statement getting eaten by an unclosed comment. That would lead to I not be initialized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps confusion between i and L in the code.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 18:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800487#M314921</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-06T18:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800512#M314937</link>
      <description>&lt;P&gt;Read your code and read the log.&lt;/P&gt;
&lt;P&gt;If you look not so closely at the highlighted code below you will see that one of the characters is numeral for one, the other is a letter , lower case L. So unless you have a numeric variable named L that has a value inside the valid range for the array using that part of the loop, it starts i with an invalid value. If you do not have a variable L the first value of I is missing. 1 l&amp;nbsp; 0 O&amp;nbsp; , one L, zero capital O are two ancient and common coding problems.&lt;/P&gt;
&lt;PRE&gt;data diet6;
set diet6;
array dbp  dbp0 dbp7 dbp20;
array sbp  sbp0 sbp7 sbp20;
array  htn htn0 htn7 htn20;
do i=&lt;FONT size="6" color="#0000FF"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/FONT&gt; to dim(dbp);
if dbp(i)ge 90 and sbp(i) ge 140 then htn(i)= "1";
else htn(i)= "0";
end;
array weightkg weightkg0 weightkg7 weightkg20;
array heightm  heightm0 heightm7  heightm20;
array bmi bmi0 bmi7 bmi20;
do i=&lt;FONT size="6" color="#FF0000"&gt;&lt;STRONG&gt;l&lt;/STRONG&gt;&lt;/FONT&gt; to dim(weightkg);
bmi(i)= (weightkg(i))/(heightm(i))**2;
end;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 23:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800512#M314937</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-06T23:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Array Not Working- Error Message: NOTE: Variable l is uninitialized. ERROR: Invalid DO loop cont</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800521#M314945</link>
      <description>&lt;P&gt;This a good example of where the DO OVER syntax that SAS has removed from the documentation would actually work a LOT better.&amp;nbsp; &amp;nbsp;The index into those arrays do not have any meaning.&amp;nbsp; They do not match the suffixes on the variable names.&amp;nbsp; There is no reason that you need to process the 0 or 7 variables before the 20 variables.&amp;nbsp; And if you don't have to write out the do loop boundaries then you are not at risk of making a typo when doing so.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data diet6_new;
  set diet6;
  array dbp  dbp0 dbp7 dbp20;
  array sbp  sbp0 sbp7 sbp20; 
  array htn $1 htn0 htn7 htn20;
  do over dbp;
    if dbp ge 90 and sbp  ge 140 then htn= "1";
    else htn= "0";
  end;
...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 01:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-Not-Working-Error-Message-NOTE-Variable-l-is-uninitialized/m-p/800521#M314945</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-07T01:11:27Z</dc:date>
    </item>
  </channel>
</rss>

