<?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: Exclude a string trailer record when the field it resides is a numeric field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232224#M308354</link>
    <description>&lt;P&gt;Show some data.&lt;/P&gt;
&lt;P&gt;If the colum&amp;nbsp;is numeric it cannot &lt;STRONG&gt;contain&lt;/STRONG&gt; "FTR*******************" if it is in a SAS data set. It would be missing.&lt;/P&gt;
&lt;P&gt;Are you attempting to READ a file into SAS?&lt;/P&gt;
&lt;P&gt;If so then what is the structure of the file being read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 29 Oct 2015 15:08:04 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-10-29T15:08:04Z</dc:date>
    <item>
      <title>Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232084#M308348</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We had to add trailer records to all our souce files we load with Data intergration. The trailer is always in the first column. In most cases this isa charater field and we can use Substring&amp;nbsp;SUBSTR(DEA_NUMBER,1,4) &amp;nbsp;^= 'TR~~' but some trailers fields are numberic and this dose not work. I cannot find and cast function or one to evaluate the data type. Can anyone help here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks ahead all&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 17:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232084#M308348</guid>
      <dc:creator>Roc</dc:creator>
      <dc:date>2015-10-28T17:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232090#M308349</link>
      <description>&lt;P&gt;We may need more information but if I understand what your are looking for then you would SUBSTR a Put value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;substr( put(numericvalue, best12.), 1,4)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or similar. possible issues for what you actually want would be where a decimal may crop up. Without specific examples of input and&amp;nbsp;desired results&amp;nbsp;a bit hard to be more specific.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 17:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232090#M308349</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-28T17:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232094#M308350</link>
      <description>&lt;P&gt;The trailer Record looks&amp;nbsp;like&amp;nbsp;&lt;/P&gt;&lt;P&gt;25633699&lt;/P&gt;&lt;P&gt;23657855&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"TR~~P~~YYYYMMDD~~HHMMSS~~RECORD_COUNT"&lt;/STRONG&gt; &amp;nbsp; &amp;lt;-- field is Numberic this is a string obviously.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need it not to load that record. We thried the above in the where and a record still loaded into results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 18:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232094#M308350</guid>
      <dc:creator>Roc</dc:creator>
      <dc:date>2015-10-28T18:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232148#M308351</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; anyalpha(x)&amp;gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt;;&lt;/P&gt;
&lt;P&gt;in the code reading the file where X is name of the variable you are reading that contains the possibly objectionable all digit values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to provide more details of the structure and contents of the input file.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 23:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232148#M308351</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-28T23:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232160#M308352</link>
      <description>&lt;P&gt;Thanks for the replies but those only work on a column that is defined as character. My column is numeric and the trailer record is character "FTR*******************. It never loads the trailer value but it loads empty into all other values. Basically what I need is a function that looks at a number and asks is it a number true or false.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Ahead all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I could evaluate the 1st number as 1 or 2 or 4 might work but not sure i can extract the 1st number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 03:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232160#M308352</guid>
      <dc:creator>Roc</dc:creator>
      <dc:date>2015-10-29T03:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232188#M308353</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; Just use a CAT function within the SUBSTR function (works with CHAR and NUM variables) ...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input x y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if substr(cat(x),1,4) eq '9999';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;99992345 1224&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;12347890 7865&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;89999999 1234&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the LOG (no errors, no warnings) ......&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;6&amp;nbsp;&amp;nbsp; data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;17&amp;nbsp;&amp;nbsp; input x y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;18&amp;nbsp;&amp;nbsp; if substr(cat(x),1,4) eq '9999';&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;19&amp;nbsp;&amp;nbsp; datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NOTE: The data set WORK.X has 1 observations and 2 variables.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 12:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232188#M308353</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-29T12:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude a string trailer record when the field it resides is a numeric field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232224#M308354</link>
      <description>&lt;P&gt;Show some data.&lt;/P&gt;
&lt;P&gt;If the colum&amp;nbsp;is numeric it cannot &lt;STRONG&gt;contain&lt;/STRONG&gt; "FTR*******************" if it is in a SAS data set. It would be missing.&lt;/P&gt;
&lt;P&gt;Are you attempting to READ a file into SAS?&lt;/P&gt;
&lt;P&gt;If so then what is the structure of the file being read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 15:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-a-string-trailer-record-when-the-field-it-resides-is-a/m-p/232224#M308354</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-10-29T15:08:04Z</dc:date>
    </item>
  </channel>
</rss>

