<?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 proc import problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20470#M3205</link>
    <description>hi &lt;BR /&gt;
&lt;BR /&gt;
is there any possibility to change informats , while i am importing text file into datasets using proc import.&lt;BR /&gt;
&lt;BR /&gt;
text file contains 300 variables.</description>
    <pubDate>Fri, 17 Apr 2009 08:09:26 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-04-17T08:09:26Z</dc:date>
    <item>
      <title>proc import problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20470#M3205</link>
      <description>hi &lt;BR /&gt;
&lt;BR /&gt;
is there any possibility to change informats , while i am importing text file into datasets using proc import.&lt;BR /&gt;
&lt;BR /&gt;
text file contains 300 variables.</description>
      <pubDate>Fri, 17 Apr 2009 08:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20470#M3205</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-17T08:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc import problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20471#M3206</link>
      <description>although a variable can have only one informat declared in a data set, in a data step it can have a different informat every time it appears on an input statement. &lt;BR /&gt;
With the INPUTN() function, it could have a different informat every time the function is executed!&lt;BR /&gt;
Of course these levels of flexibility disappear in PROC IMPORT &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
 &lt;BR /&gt;
 I recommend making the DATA STEP your friend.&lt;BR /&gt;
 &lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Fri, 17 Apr 2009 09:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20471#M3206</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-04-17T09:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc import problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20472#M3207</link>
      <description>Assuming you are referring to TEXT files CSV, TXT etc. you can easily run PROC IMPORT and cut and paste the "generated code".  Then you can change the informat by editing the existing INFORMAT statements. Or by adding additional statements,  where you can use "SAS Variable Lists" to make short work of 300 variables.  Or as was suggested you can modify the INPUT statement to include INFORMATS.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data TEST;&lt;BR /&gt;
   %let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;
   infile FT15F001 delimiter = ',' MISSOVER DSD  firstobs=2 ;&lt;BR /&gt;
   informat a $1. ;&lt;BR /&gt;
   informat b $1. ;&lt;BR /&gt;
   informat c $1. ;&lt;BR /&gt;
   format a $1. ;&lt;BR /&gt;
   format b $1. ;&lt;BR /&gt;
   format c $1. ;&lt;BR /&gt;
&lt;BR /&gt;
   informat a--b $upcase1.; * added to change INFORMAT;&lt;BR /&gt;
   ** NO need to bother the statements above unless the TYPE is changed.;&lt;BR /&gt;
&lt;BR /&gt;
   input&lt;BR /&gt;
            a $&lt;BR /&gt;
            b $&lt;BR /&gt;
            c $&lt;BR /&gt;
   ;&lt;BR /&gt;
   &lt;BR /&gt;
   &lt;BR /&gt;
   if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */&lt;BR /&gt;
   run;&lt;BR /&gt;
proc contents varnum;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 17 Apr 2009 13:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-problem/m-p/20472#M3207</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-04-17T13:03:47Z</dc:date>
    </item>
  </channel>
</rss>

