<?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: Identifying data longer than defined in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261125#M50751</link>
    <description>&lt;P&gt;I might be tempted to read the data with the specification and then turn Proc import loose with a large guessing rows option.. Look at the resulting variable lengths by position in the dataset using either proc contents, Sashelp.vcolumn&amp;nbsp;or&amp;nbsp;Dictionary.columns. If there are&amp;nbsp;variables in the proc import results that are longer then the defined variables then you something&amp;nbsp;to target.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2016 16:42:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-04-04T16:42:10Z</dc:date>
    <item>
      <title>Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261119#M50748</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have raw data in .csv file. The length of all the attributes are defined and given by business but they still would like to identify if any data has exceeded already defined length.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i do identify ? What if column A has length greater than 11 in Raw File? How can i filter the observation out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;dataset1&amp;gt; &amp;lt;dataset2&amp;gt;;&lt;BR /&gt;INFILE &amp;lt;fileName&amp;gt;&lt;BR /&gt;DLM=',' LRECL=32000 DSD MISSOVER FIRSTOBS=2 TERMSTR=CRLF;&lt;BR /&gt;INPUT&lt;BR /&gt;A :$11.&lt;BR /&gt;B&lt;BR /&gt;C :$54.&lt;BR /&gt;;&lt;BR /&gt;IF _ERROR_=1 THEN OUTPUT &amp;lt;dataset1&amp;gt;;&lt;BR /&gt;ELSE OUTPUT &amp;lt;dataset2&amp;gt;;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 16:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261119#M50748</guid>
      <dc:creator>Vimal_Kurup</dc:creator>
      <dc:date>2016-04-04T16:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261121#M50750</link>
      <description>&lt;P&gt;Try make your informats much wider/longer.&lt;/P&gt;
&lt;P&gt;But this will make quite an over head for your data import process. A simple matter of filed length should be&amp;nbsp;verified by the sending party.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 16:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261121#M50750</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-04-04T16:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261125#M50751</link>
      <description>&lt;P&gt;I might be tempted to read the data with the specification and then turn Proc import loose with a large guessing rows option.. Look at the resulting variable lengths by position in the dataset using either proc contents, Sashelp.vcolumn&amp;nbsp;or&amp;nbsp;Dictionary.columns. If there are&amp;nbsp;variables in the proc import results that are longer then the defined variables then you something&amp;nbsp;to target.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 16:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261125#M50751</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-04-04T16:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261172#M50771</link>
      <description>&lt;P&gt;Do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DATA &amp;lt;dataset1&amp;gt; &amp;lt;dataset2&amp;gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INFILE &amp;lt;fileName&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DLM=',' LRECL=32000 DSD MISSOVER FIRSTOBS=2 TERMSTR=CRLF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;INPUT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A :$32.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;C :$54.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IF _ERROR_=1 OR length(A) &amp;gt; 11 THEN OUTPUT &amp;lt;dataset1&amp;gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ELSE OUTPUT &amp;lt;dataset2&amp;gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 18:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261172#M50771</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-04T18:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261272#M50805</link>
      <description>&lt;PRE&gt;
Check length= option:


INFILE &lt;FILENAME&gt;
DLM=',' LRECL=32000 DSD MISSOVER FIRSTOBS=2 TERMSTR=CRLF
length=len ;
INPUT
A :$11. @;
put len=;

INPUT B @;
put len=;

INPUT C :$54. @;
put len=;


&lt;/FILENAME&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Apr 2016 03:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261272#M50805</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-04-05T03:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261276#M50807</link>
      <description>&lt;PRE&gt;
Opps.
Check column= option

INFILE 
DLM=',' LRECL=32000 DSD MISSOVER FIRSTOBS=2 TERMSTR=CRLF
column=len ;
INPUT
A :$11. @;
put len=;

INPUT B @;
put len=;

INPUT C :$54. @;
put len=;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Apr 2016 04:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261276#M50807</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-04-05T04:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261283#M50809</link>
      <description>&lt;P&gt;How about using a macro?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro do_input(varname,len);
input ___&amp;amp;varname :$%eval(&amp;amp;len+100). @;
length &amp;amp;varname $&amp;amp;len;
&amp;amp;varname = ___&amp;amp;varname;
if length(___&amp;amp;varname) &amp;gt; &amp;amp;len
then &amp;amp;varname._err = 1;
else &amp;amp;varname._err = 0;
drop ___&amp;amp;varname;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Apr 2016 06:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/261283#M50809</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T06:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/263614#M51596</link>
      <description>I have employed something very similar. Thanks for your time</description>
      <pubDate>Wed, 13 Apr 2016 17:54:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/263614#M51596</guid>
      <dc:creator>Vimal_Kurup</dc:creator>
      <dc:date>2016-04-13T17:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying data longer than defined</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/263615#M51597</link>
      <description>Hi Kurt,&lt;BR /&gt;&lt;BR /&gt;Thanks for your time. I have employed something very similar though not through macro.&lt;BR /&gt;&lt;BR /&gt;I like your solution.</description>
      <pubDate>Wed, 13 Apr 2016 17:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identifying-data-longer-than-defined/m-p/263615#M51597</guid>
      <dc:creator>Vimal_Kurup</dc:creator>
      <dc:date>2016-04-13T17:55:52Z</dc:date>
    </item>
  </channel>
</rss>

