<?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: automate the process to import multiple spreadsheeet using proc import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254735#M48612</link>
    <description>Hi, Peter:&lt;BR /&gt;  I know it is not necessary, since the LENGTH statement establishes the column as CHAR, but I do it in the interests of maintenance. I used to work in a small shop where my only backup was a non-SAS person who understood that $ meant character, but did not necessarily know much else. So if he copied anything from my program, I wanted to be as explicit as possible. The $ in the LENGTH and $ in the INPUT were redundant, but I felt better leaving him with my programs that way.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
    <pubDate>Sat, 05 Mar 2016 16:30:16 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-03-05T16:30:16Z</dc:date>
    <item>
      <title>automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254459#M48533</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;i want to automate to import multiple spreadhsheet using array.&lt;/P&gt;&lt;P&gt;please suggest.&lt;/P&gt;&lt;P&gt;Below is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data file_data;&lt;BR /&gt;input dset $7. Src $30. sfil $42.;&lt;BR /&gt;cards;&lt;BR /&gt;Heatmap Heat Map_Nulls_Financia_Freq &amp;nbsp;Load 9 Test 1 Q412_24Feb2016_rerun_dd.xlsx&lt;BR /&gt;p_value Sheet2 final data_deepak_2.xlsx&lt;BR /&gt;load9 Q4 load9.xlsx&lt;BR /&gt;ticket Tickets Tickets.xlsx&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;====================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select dset into : sdata separated by ' ' from file_data;&lt;BR /&gt;select src into : sfile separated by ' ' from file_data;&lt;BR /&gt;select sfil into : spath separated by ' ' from file_data;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;var. &amp;amp;mnth. &amp;amp;cnt. &amp;amp;s_mth. &amp;amp;sdata. &amp;amp;sfile. &amp;amp;spath.;&lt;BR /&gt;%let path=C:\Users\212475280\Desktop\RDG\;&lt;BR /&gt;%put &amp;amp;path.;&lt;/P&gt;&lt;P&gt;=======================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data _Null_;&lt;BR /&gt;Array dd(*) &amp;amp;sdata.;&lt;BR /&gt;array cc(*) &amp;amp;sfile.;&lt;BR /&gt;Array bb(*) &amp;amp;spath.;&lt;BR /&gt;do i=1 to dim(dd);&lt;BR /&gt;PROC IMPORT OUT= dd.dd(i)&lt;BR /&gt;DATAFILE= "&amp;amp;path.bb(i)"&lt;BR /&gt;DBMS=EXCEL REPLACE;&lt;BR /&gt;RANGE="cc(i)$";&lt;BR /&gt;GETNAMES=YES;&lt;BR /&gt;MIXED=NO;&lt;BR /&gt;SCANTEXT=YES;&lt;BR /&gt;USEDATE=YES;&lt;BR /&gt;SCANTIME=YES;&lt;BR /&gt;RUN;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 14:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254459#M48533</guid>
      <dc:creator>Dd07</dc:creator>
      <dc:date>2016-03-04T14:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254465#M48535</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at these two blog entries&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2012/03/20/sas-program-by-processing/" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2012/03/20/sas-program-by-processing/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2012/03/23/improving-on-a-sas-programming-pattern/" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2012/03/23/improving-on-a-sas-programming-pattern/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger﻿&lt;/a&gt; they explain in detail how to do what you want. It is all about running specific SAS code for a list of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The program pattern is using the SAS macro language and not the DATA Step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254465#M48535</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-03-04T15:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254468#M48537</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This type of question gets asked a fair bit, there are several topics on here if you search. &amp;nbsp;Firstly why do you have multiple files and why use Excel? &amp;nbsp;If your going for an automated import process then I would suggest you step back from the how, and look at the whole picture. &amp;nbsp;Where does the data come from, setup up an agreement to provide the data in an appropriate format (CSV, XML) at given times with a set format. &amp;nbsp;Once that is signed off by all parties, then look at how best to get that data into your system. &amp;nbsp;Any attempt to "just import a spreadsheet" will fall over every time it is run, I can pretty much guarentee it. &amp;nbsp;Excel is by its nature not structured - what happens if the user puts a picture in cell one, or moves all the data to D:F? &amp;nbsp;This is why it is far more important to get an agreement in place, i.e. this is wht you will send, this is how it will, deviation from this format will create overhead in terms of work.&lt;/P&gt;
&lt;P&gt;Proc import is not the best tool for getting data in either, it is a guessing procedure. &amp;nbsp;It looks at the file and guesses what it is supposed to do, this again is a place where the process can break down. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the agreement, the data is in an appropriate format, then the whole process of automating it is very simple, can be done with either 1 or two datasteps and will be pretty robust, plus if it fails, its most likely to be the vendor not complying with the agreement.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 15:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254468#M48537</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-04T15:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254485#M48545</link>
      <description>thankyou for writing..&lt;BR /&gt;could you just summarize or send me any reference for the data step which i can use for the automation ..&lt;BR /&gt;&lt;BR /&gt;It will be great help</description>
      <pubDate>Fri, 04 Mar 2016 15:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254485#M48545</guid>
      <dc:creator>Dd07</dc:creator>
      <dc:date>2016-03-04T15:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254537#M48561</link>
      <description>&lt;P&gt;Well,the datastep is really quite basic. &amp;nbsp;Its more about the process, and the data. &amp;nbsp;Do you have one CSV to import, if there are multiple CSV files, can they be appened (i.e. are they thw same). &amp;nbsp;The code is simple - the documentation is the difficult bit:&lt;/P&gt;
&lt;PRE&gt;data want;
  infile "c:\&amp;lt;your_file&amp;gt;.csv";
  length var1 $20 
            var3 $10...;
  input  var1 $
           var2 
           var3 $...;
  format ...;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Mar 2016 17:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254537#M48561</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-04T17:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254701#M48608</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&lt;BR /&gt;Why do so many people add that trailing $ on INPUT statements when the data types are already defined as character?&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Mar 2016 09:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254701#M48608</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-03-05T09:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254735#M48612</link>
      <description>Hi, Peter:&lt;BR /&gt;  I know it is not necessary, since the LENGTH statement establishes the column as CHAR, but I do it in the interests of maintenance. I used to work in a small shop where my only backup was a non-SAS person who understood that $ meant character, but did not necessarily know much else. So if he copied anything from my program, I wanted to be as explicit as possible. The $ in the LENGTH and $ in the INPUT were redundant, but I felt better leaving him with my programs that way.&lt;BR /&gt; &lt;BR /&gt;cynthia</description>
      <pubDate>Sat, 05 Mar 2016 16:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254735#M48612</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-03-05T16:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: automate the process to import multiple spreadsheeet using proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254749#M48614</link>
      <description>&lt;P&gt;Habit is part of it. &amp;nbsp;Also, if it doesn't matter if it is there or not, but it makes reading the input line easliy then I would always put it in. &amp;nbsp;Much the same as with cat() function, you don't need to explicitly put numbers to character, however i would always do that anyway to make it very clear what is happening. &amp;nbsp;Actual programming is very low on the priorty to me, documentation and easy to read code is far more important that saving a few characters.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2016 17:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/automate-the-process-to-import-multiple-spreadsheeet-using-proc/m-p/254749#M48614</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-05T17:25:43Z</dc:date>
    </item>
  </channel>
</rss>

