<?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: adding record for multiple rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427253#M105350</link>
    <description>&lt;P&gt;Assuming in your actual data file each record format HD, BS, AS etc. occur on a single line then something like this skeleton program may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   infile "your file" dlm='|' lrecl=32000;
   informat block $2.;
   /*informats to describe other variables to be read go here*/
   input block @;
   /* each input statement below should read the variables
      for that block
   */
   Select (block);
      when ('AS')
         input ASvar1 ASvar2 ASvar3 ;
      when ('BS')
         input bsvar1 bsvar2 bsvar3 ;
      when ('CS')
         input CSvar1 CSvar2 CSvar3 ;
      when ('HD')
         input HDvar1 HDvar2 HDvar3 ;
      when ('RS')
         input RSvar1 RSvar2 RSvar3 ;
     otherwise;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;You would have to supply the variable names and attributes from some documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jan 2018 16:33:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-01-12T16:33:35Z</dc:date>
    <item>
      <title>adding record for multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427116#M105305</link>
      <description>&lt;P&gt;​i have fixed length file which has 5 segments and each segment in turn has 20 columns each for 1000 records.&lt;/P&gt;&lt;P&gt;i want to group&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;all segments together and do&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;maupulation and then assign them back to the records they belong.&lt;/P&gt;&lt;P&gt;but there is no primary key for combining the segments back to their respective record and hence wnt to make a common id for all the segments belonging to each individual record&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e want to create something like this so that i can take each segment convert the fixed length to columns and then assign each segment to their respective record based on the record id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;record&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;address segment&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;v1&lt;/TD&gt;&lt;TD&gt;v2&lt;/TD&gt;&lt;TD&gt;v3&lt;/TD&gt;&lt;TD&gt;v4&lt;/TD&gt;&lt;TD&gt;v5&lt;/TD&gt;&lt;TD&gt;v6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;borrower segmrnt&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;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t;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 12 Jan 2018 07:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427116#M105305</guid>
      <dc:creator>Jinson</dc:creator>
      <dc:date>2018-01-12T07:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: adding record for multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427117#M105306</link>
      <description>&lt;P&gt;Please post your example data in a data step, as described in&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; and &lt;A href="https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce" target="_blank"&gt;https://communities.sas.com/t5/help/faqpage/faq-category-id/posting?nobounce&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 08:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427117#M105306</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-12T08:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: adding record for multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427149#M105312</link>
      <description>&lt;P&gt;kindly find attached the sample data.&lt;/P&gt;&lt;P&gt;here HD BS AS RS and CS represents the 5 segments and data corresponding to them are the different fields in fixed length.&lt;/P&gt;&lt;P&gt;this is an example of only 1 record&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 11:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427149#M105312</guid>
      <dc:creator>Jinson</dc:creator>
      <dc:date>2018-01-12T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: adding record for multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427153#M105316</link>
      <description>&lt;P&gt;So it looks that you have groups of records with different record types, recognizable by the value in the first 2-character column.&lt;/P&gt;
&lt;P&gt;Each block starts with a 'BS' and ends with a 'CD'.&lt;/P&gt;
&lt;P&gt;Can you supply the structure for the BS, AS, RS, CR, GS, SS and CD lines? And how you expect that to end up in a SAS dataset or in a group of datasets?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 11:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427153#M105316</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-12T11:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: adding record for multiple rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427253#M105350</link>
      <description>&lt;P&gt;Assuming in your actual data file each record format HD, BS, AS etc. occur on a single line then something like this skeleton program may help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
   infile "your file" dlm='|' lrecl=32000;
   informat block $2.;
   /*informats to describe other variables to be read go here*/
   input block @;
   /* each input statement below should read the variables
      for that block
   */
   Select (block);
      when ('AS')
         input ASvar1 ASvar2 ASvar3 ;
      when ('BS')
         input bsvar1 bsvar2 bsvar3 ;
      when ('CS')
         input CSvar1 CSvar2 CSvar3 ;
      when ('HD')
         input HDvar1 HDvar2 HDvar3 ;
      when ('RS')
         input RSvar1 RSvar2 RSvar3 ;
     otherwise;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;You would have to supply the variable names and attributes from some documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/adding-record-for-multiple-rows/m-p/427253#M105350</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-12T16:33:35Z</dc:date>
    </item>
  </channel>
</rss>

