<?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 input variable at differing offset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43814#M8989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Something like this should work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile in;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ = 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @10 offset ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * read the varying offset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain offset;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * keep this value across observations;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop offset;&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; * don't include on output dataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @offset customer $10. ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * all subsequent records;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Aug 2011 13:46:44 GMT</pubDate>
    <dc:creator>DLing</dc:creator>
    <dc:date>2011-08-05T13:46:44Z</dc:date>
    <item>
      <title>input variable at differing offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43812#M8987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to process a file with records that have a 'header' with fixed layout, and a body with a variable layout. There is information in the fixed header of the offset within the record for a variable I am trying to read. For example, in the header at say position 10 there is a variable which has the offset location for say a customer name. I can read this offset easy enough, but how would I then input into a CUSTOMER variable from this offset? @OFFSET CUSTOMER $10. ?? I haven't tried this but I am doubtful it will work and hope someone else knows how to process files of this kind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 12:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43812#M8987</guid>
      <dc:creator>spanky4_3</dc:creator>
      <dc:date>2011-08-05T12:43:28Z</dc:date>
    </item>
    <item>
      <title>input variable at differing offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43813#M8988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will be easier for people to provide some direction if you provided a small example of what one of the files looks like.&amp;nbsp; It sounds like you only need to parse the header record and then apply it to the other records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following thread contains some examples that might be helpful:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.mathkb.com/Uwe/Forum.aspx/sas/26816/Reading-in-a-flat-file-with-dynamic-headers"&gt;http://www.mathkb.com/Uwe/Forum.aspx/sas/26816/Reading-in-a-flat-file-with-dynamic-headers&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 13:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43813#M8988</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-05T13:36:59Z</dc:date>
    </item>
    <item>
      <title>input variable at differing offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43814#M8989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Something like this should work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile in;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ = 1 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @10 offset ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * read the varying offset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain offset;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * keep this value across observations;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop offset;&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; * don't include on output dataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @offset customer $10. ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * all subsequent records;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2011 13:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43814#M8989</guid>
      <dc:creator>DLing</dc:creator>
      <dc:date>2011-08-05T13:46:44Z</dc:date>
    </item>
    <item>
      <title>input variable at differing offset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43815#M8990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; spanky3_3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you suggest ' I haven't tried this but I am doubtful it will work'&lt;/P&gt;&lt;P&gt;don't be doubtful - it does work&lt;/P&gt;&lt;P&gt;but remember to retain the 'OFFSET' variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;peterC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 22:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-variable-at-differing-offset/m-p/43815#M8990</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-08-10T22:18:43Z</dc:date>
    </item>
  </channel>
</rss>

