<?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: no change in main file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241094#M44625</link>
    <description>&lt;P&gt;I would recommend changing the second step such that it creates a new data set, not overwriting the imported data set and then checking. &lt;BR /&gt;&lt;BR /&gt;Please post the log, one check is to make sure your loop condition is ever executed.&lt;BR /&gt;&lt;BR /&gt;data work.check_condition1;&lt;BR /&gt;set work.Ggp1;&lt;BR /&gt;if x1 &amp;gt; 1 then output;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Dec 2015 02:44:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-29T02:44:18Z</dc:date>
    <item>
      <title>no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241093#M44624</link>
      <description>&lt;P&gt;Hi I have imported a data file from CSV fromat &amp;nbsp;which have 28243 rows and 2296 varables using following code:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;IMPORT&lt;/STRONG&gt; OUT= Ggp1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE="G:\seleg.csv"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=csv REPLACe;&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; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAROW=&lt;STRONG&gt;2&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;guessingrows=&lt;STRONG&gt;32767&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;Run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;Now I'm running follwong code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data &lt;/STRONG&gt;work.Ggp1;&lt;/P&gt;&lt;P&gt;set work.Ggp1;&lt;/P&gt;&lt;P&gt;array _v{*} v:;&lt;/P&gt;&lt;P&gt;if x1 &amp;gt; &lt;STRONG&gt;1&lt;/STRONG&gt; then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = max(&lt;STRONG&gt;815&lt;/STRONG&gt;,x1) to min(dim(_v),xx1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _v{i} = &lt;STRONG&gt;2&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;drop i;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the log shows that the program has run successfully and shows no error message. But I check the data file, I don't see any change&amp;nbsp;in the data file, can you tell my how to fix this problem?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 01:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241093#M44624</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T01:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241094#M44625</link>
      <description>&lt;P&gt;I would recommend changing the second step such that it creates a new data set, not overwriting the imported data set and then checking. &lt;BR /&gt;&lt;BR /&gt;Please post the log, one check is to make sure your loop condition is ever executed.&lt;BR /&gt;&lt;BR /&gt;data work.check_condition1;&lt;BR /&gt;set work.Ggp1;&lt;BR /&gt;if x1 &amp;gt; 1 then output;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 02:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241094#M44625</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-29T02:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241099#M44629</link>
      <description>&lt;P&gt;There's one additional check to make, concerning this range:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;do i = max(&lt;/SPAN&gt;&lt;STRONG&gt;815&lt;/STRONG&gt;&lt;SPAN&gt;,x1) to min(dim(_v),xx1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Have you checked that max(815,x1) is actually less than or equal to min(dim(_v),xx1) ??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 03:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241099#M44629</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-29T03:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241103#M44630</link>
      <description>&lt;P&gt;yep, x1 is less than or equal to xx1.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 03:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241103#M44630</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T03:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241104#M44631</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thanks a lot. the attachment contains the CSV file, would you pls check that? mainly I intended to recode the variavbles starts from v815 to v1360, depending the values of x1 and xx1.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 04:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241104#M44631</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T04:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241105#M44632</link>
      <description>&lt;P&gt;hi, the attachment contains the CSV data file.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 04:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241105#M44632</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T04:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241106#M44633</link>
      <description>I have created new file instead of reqriting, still there is no change.....actually, if we run the code, the output file should contain 2 instead of 1 from colomn no. 941 to 945 in row 36.</description>
      <pubDate>Tue, 29 Dec 2015 04:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241106#M44633</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T04:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241107#M44634</link>
      <description>&lt;P&gt;the log:&lt;/P&gt;&lt;P&gt;data sasuser.ggp2;&lt;BR /&gt;2472 set sasuser.ggp1;&lt;BR /&gt;2473 array _v{*} v:;&lt;BR /&gt;2474 if x1 &amp;gt; 1 then&lt;BR /&gt;2475 do i = max(815,x1) to min(dim(_v),xx1);&lt;BR /&gt;2476 _v{i} = 5;&lt;BR /&gt;2477 end;&lt;BR /&gt;2478 drop i;&lt;BR /&gt;2479 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 474 observations read from the data set SASUSER.GGP1.&lt;BR /&gt;NOTE: The data set SASUSER.GGP2 has 474 observations and 671 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2480 data work.check_condition1;&lt;BR /&gt;2481 set sasuser.ggp1;&lt;BR /&gt;2482 if x1 &amp;gt; 1 then output;&lt;BR /&gt;2483 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 474 observations read from the data set SASUSER.GGP1.&lt;BR /&gt;NOTE: The data set WORK.CHECK_CONDITION1 has 37 observations and 671 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 04:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241107#M44634</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-29T04:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241108#M44635</link>
      <description>No attachment...perhaps its being virus checked.</description>
      <pubDate>Tue, 29 Dec 2015 05:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241108#M44635</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-29T05:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241114#M44641</link>
      <description>&lt;P&gt;I think the other suggestion of the do loop conditions is correct, once your log is examined.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your log shows&amp;nbsp;671 variables. &amp;nbsp;So I have no idea what X1 is, but assuming it takes&amp;nbsp;a value within the range of 1 to 671 the max condition always evaluates to 815 and then whatever the lower interval is, but that loop will never execute. &amp;nbsp;Test the condition again with a put statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;do i = max(&lt;/SPAN&gt;&lt;STRONG&gt;815&lt;/STRONG&gt;&lt;SPAN&gt;,x1) to min(dim(_v),xx1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;NOTE: The data set SASUSER.GGP2 has 474 observations and 671 variables.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Check the log to see if the loop is ever entered. You could also need a BY -1 if you plan to count down, but then I think the variable i won't be a valid index for your array.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sasuser.ggp2;
set sasuser.ggp1;
array _v{*} v:;
if x1 &amp;gt; 1 then
do i = max(815,x1) to min(dim(_v),xx1);
 _v{i} = 5;
put 'In Do Loop';
 end;
 drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 06:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241114#M44641</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-29T06:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241130#M44643</link>
      <description>&lt;P&gt;It's not enough to verify that x1 &amp;lt;= xx1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even when x1 &amp;lt;= xx1, the DO loop may be starting at 815, not at x1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to check for the actual conditions that your program uses. &amp;nbsp;Are there any observations where:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;max(815,x1) &amp;lt;= min(dim(_v),xx1)&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 13:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241130#M44643</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-29T13:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241191#M44669</link>
      <description>&lt;P&gt;I'm really very new, would u please tell me what does&amp;nbsp;&lt;SPAN&gt;max(815,x1) mean practically?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 02:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241191#M44669</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-30T02:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241192#M44670</link>
      <description>&lt;P&gt;&lt;SPAN&gt;wha does the hole statement mean? &amp;nbsp; max(815,x1) &amp;lt;= min(dim(_v),xx1)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 02:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241192#M44670</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-30T02:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241195#M44673</link>
      <description>Max is a function, that takes the maximum of the two arguments. &lt;BR /&gt;&lt;BR /&gt;In this case for every row, it evaluates to the maximum of 815 and the value of X1 variable.  &lt;BR /&gt;&lt;BR /&gt;If you don't know what the parts mean, break out the code so you can examine it line by line. Here's an example. Look at the values that the check_flag's take over your data set, specifically what the start and ending for the do loop would be, and if they're what you intended.&lt;BR /&gt;&lt;BR /&gt;data sasuser.ggp2;&lt;BR /&gt;set sasuser.ggp1;&lt;BR /&gt;array _v{*} v:;&lt;BR /&gt;if x1&amp;gt;1 then check_flag1=1;&lt;BR /&gt;else check_flag1=0;&lt;BR /&gt;check_flag2=max(815, x1);&lt;BR /&gt;check_flag3=min(dim(_v), xx1);&lt;BR /&gt;check_flag4=dim(_v);&lt;BR /&gt;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 30 Dec 2015 03:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241195#M44673</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-30T03:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241208#M44681</link>
      <description>&lt;P&gt;&lt;SPAN&gt;thanks a lot, thank you very much for your cooperaion.....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 08:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241208#M44681</guid>
      <dc:creator>mahfuz_pops</dc:creator>
      <dc:date>2015-12-30T08:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: no change in main file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241221#M44687</link>
      <description>&lt;P&gt;As Reeza mentioned, max(815, x1) means whichever is larger (815 or x1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similary, min takes whichever is smaller (but omits missing values). &amp;nbsp;So min(dim(_v), xx1) means take whichever is smaller, either the number of elements in the array or the value of xx1.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2015 15:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/no-change-in-main-file/m-p/241221#M44687</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-30T15:03:50Z</dc:date>
    </item>
  </channel>
</rss>

