<?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 Problem with Put and missing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549504#M152489</link>
    <description>&lt;P&gt;Why doesn't the following code work? When I run it, I get 20 commas in the log (followed by the value of i, 101 on the next line), but I am expecting five rows of 20 commas. If I change it to v(i)=1, it works as expected, with multiple rows of 1 followed by a comma.&amp;nbsp; [This is abstracted from a large program where missing values seem to messing up my output]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data _null_;
array v(*) v1-v100;
do i=1 to dim(v);
  v(i)=.;
end;
file log dsd ls=20 dlm="," ;
put (_all_) (:);
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 07:26:00 GMT</pubDate>
    <dc:creator>BruceBrad</dc:creator>
    <dc:date>2019-04-09T07:26:00Z</dc:date>
    <item>
      <title>Problem with Put and missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549504#M152489</link>
      <description>&lt;P&gt;Why doesn't the following code work? When I run it, I get 20 commas in the log (followed by the value of i, 101 on the next line), but I am expecting five rows of 20 commas. If I change it to v(i)=1, it works as expected, with multiple rows of 1 followed by a comma.&amp;nbsp; [This is abstracted from a large program where missing values seem to messing up my output]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data _null_;
array v(*) v1-v100;
do i=1 to dim(v);
  v(i)=.;
end;
file log dsd ls=20 dlm="," ;
put (_all_) (:);
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 07:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549504#M152489</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2019-04-09T07:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Put and missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549525#M152498</link>
      <description>&lt;P&gt;It seems like a bug to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, you could use a codification for missing values, for instance :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;option missing="M";&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 09:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549525#M152498</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-04-09T09:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Put and missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549825#M152618</link>
      <description>&lt;P&gt;I'm trying to read the data back into SAS using&lt;/P&gt;&lt;P&gt;input (_all_)( : );&lt;/P&gt;&lt;P&gt;(After first defining the variable list and informats using attrib statements).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, to use your work around I have to add&lt;/P&gt;&lt;P&gt;missing M;&lt;/P&gt;&lt;P&gt;prior to the input statement. This works, though the missings are now read in as .M rather than generic missing (.). I then need to follow up with array loop to recode them to my preferred generic missing.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;PS I've sent this on to tech support.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 00:40:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549825#M152618</guid>
      <dc:creator>BruceBrad</dc:creator>
      <dc:date>2019-04-10T00:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Put and missing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549875#M152638</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use a user defined informat to interpret M's as missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
    invalue v
	    "M"=.
	    other=best.
    ;
run;

option missing=".";
data test;    
    informat v1-v100 v. i best.;
    infile log1 dlm="," dsd;
	input (_all_) (:);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Apr 2019 09:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-Put-and-missing-data/m-p/549875#M152638</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-04-10T09:10:39Z</dc:date>
    </item>
  </channel>
</rss>

