<div dir="ltr">GrADS users,<div><br></div><div>I am running a script that should output values into a 2 column table. The first column will be the time (monthly in the form of 00Z01JAN1979) and the second column will be the value of the variable (evap) at that time. After running the code below, I receive an error saying &quot;Unable to locate ENDWHILE statement for the WHILE statement at line 18.&quot;</div><div><br></div><div>This is the script I&#39;m running; everything before the while statement is setting up a mask (in this case, the mask only outputs values for Africa):</div><div><br></div><div><div>&#39;reinit&#39;</div><div>&#39;open /data2/control/Region15_AFR_mask_TEST.nc&#39;</div><div>&#39;set t 1 last&#39;</div><div>&#39;set dfile 1&#39;</div><div>&#39;set lon -179.5 179.5&#39;</div><div>&#39;set lat -89.5 89.5&#39;</div><div>&#39;open /data2/control/GLDAS_VIC10_M.ctl&#39;</div><div>&#39;set dfile 2&#39;</div><div>&#39;set lon -179.5 179.5&#39;</div><div>&#39;set lat -89.5 89.5&#39;</div><div>&#39;set time 00Z01JAN1979 00Z01JAN2016&#39;</div><div>&#39;set dfile 1&#39;</div><div>&#39;d aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)&#39;</div><div>&#39;set gxout print&#39;</div><div>&#39;set prnopts %6.2f 1 1&#39;</div><div>nmonths = 428</div><div>i = 1</div><div>while (i &lt;= nmonths)</div><div> &#39;set t &#39;i</div><div> &#39;q time&#39;</div><div>rectime = sublin(result,5)</div><div>recdate = subwrd(rectime,6) </div><div> &#39;d aave(maskout(evap.2,mask.1(time=00Z01JAN1979)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)&#39;</div><div>evap = sublin(result,2)</div><div>evap = subwrd(evap,1)</div><div>string = rectime&#39; &#39;evap</div><div> &#39;write(&#39;GLDAS_MASK_DATA.txt&#39; ,  string ,append)&#39;</div><div> i = i + 1</div><div>endwhile</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>I&#39;m not sure why GrADS is giving me this error.</div><div><br></div><div>-Justin</div></div>