<?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 creating one observation per detail record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452208#M114099</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;My question is that why when i execute the bellow code it gives me no output and the log says ' DATA STEP stopped due to looping'? I attached the raw data file bellow. Appreciate for any help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data people (drop=type);&lt;BR /&gt;infile 'C:\Users\myuser\Desktop\census.txt';&lt;BR /&gt;retain address ;&lt;BR /&gt;if type='H' then input @3 address $15. ;&lt;BR /&gt;if type='P';&lt;BR /&gt;input @3 name $10.&amp;nbsp;&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83330"&gt;@13&lt;/a&gt; age $3.&amp;nbsp; @16gender $1. ;&lt;BR /&gt;proc print data=people;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Apr 2018 15:33:45 GMT</pubDate>
    <dc:creator>fatemeh</dc:creator>
    <dc:date>2018-04-07T15:33:45Z</dc:date>
    <item>
      <title>creating one observation per detail record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452208#M114099</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;My question is that why when i execute the bellow code it gives me no output and the log says ' DATA STEP stopped due to looping'? I attached the raw data file bellow. Appreciate for any help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data people (drop=type);&lt;BR /&gt;infile 'C:\Users\myuser\Desktop\census.txt';&lt;BR /&gt;retain address ;&lt;BR /&gt;if type='H' then input @3 address $15. ;&lt;BR /&gt;if type='P';&lt;BR /&gt;input @3 name $10.&amp;nbsp;&amp;nbsp; &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83330"&gt;@13&lt;/a&gt; age $3.&amp;nbsp; @16gender $1. ;&lt;BR /&gt;proc print data=people;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 15:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452208#M114099</guid>
      <dc:creator>fatemeh</dc:creator>
      <dc:date>2018-04-07T15:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: creating one observation per detail record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452209#M114100</link>
      <description>&lt;P&gt;are you after something like this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data people(drop=type) ;
infile 'C:\Users\NSRINIV2\Desktop\census.txt' truncover;
retain address ;
input type $ @;
if type='H' then input @2 address $15. ;
else if type='P' then input @3 name $10.   @13 age $3.  @16gender $1. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Apr 2018 15:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452209#M114100</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-04-07T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating one observation per detail record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452211#M114101</link>
      <description>&lt;P&gt;Because you never executed the INPUT statement.&lt;/P&gt;
&lt;P&gt;Your subsetting IF statement is testing the variable TYPE before it has be assigned any values. So TYPE='P' is always false and your data step never makes it past this line.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Apr 2018 16:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-one-observation-per-detail-record/m-p/452211#M114101</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-04-07T16:25:19Z</dc:date>
    </item>
  </channel>
</rss>

