<?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: Need to import tabular type report in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485195#M287114</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224236"&gt;@nishSAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes my data is in excel format and whatever data i have provided in the example file is as it is what i have&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually if you added the header Normalization then you modified the data to a different format.&lt;/P&gt;
&lt;P&gt;Also your Table 2 modified the data. So your posted example is not what you actually have. You should post an example as it actually exists.&lt;/P&gt;
&lt;P&gt;Also your example output has two column headers "metric" which is not acceptable for SAS data sets.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 15:48:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-08-08T15:48:11Z</dc:date>
    <item>
      <title>Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485154#M287111</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help me to&amp;nbsp;import the tabular type report into SAS data set. Once that report gets import into SAS then i want to transpose that data set with regular data form.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;attached excel file for your reference as i have&amp;nbsp;"Table 1" data which i want to convert into "Table 2" form in SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this description helps you to understand my issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nishant Paranjpe&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 13:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485154#M287111</guid>
      <dc:creator>nishSAS</dc:creator>
      <dc:date>2018-08-08T13:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485167#M287112</link>
      <description>&lt;P&gt;First thing, is your actual report file in Excel or something else? If something else then provide that document, not Excel.&lt;/P&gt;
&lt;P&gt;If the files are in Excel have you installed the SAS PCfiles server? that may be the easiest way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second thing, is that example table one exactly like that or does it have different numbers of columns and with different "date" column headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe it will be easier to read into a the normalized form instead of reading and then transposing because the column headers you have, in typical Excel user fashion, are not valid for SAS variable names and will be ugly; the multiple sections of "table" information are going to require parsing in the first place as you do not want the blank lines or the total rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485167#M287112</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T14:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485175#M287113</link>
      <description>&lt;P&gt;Yes my data is in excel format and whatever data i have provided in the example file is as it is what i have&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 14:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485175#M287113</guid>
      <dc:creator>nishSAS</dc:creator>
      <dc:date>2018-08-08T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485195#M287114</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224236"&gt;@nishSAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes my data is in excel format and whatever data i have provided in the example file is as it is what i have&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually if you added the header Normalization then you modified the data to a different format.&lt;/P&gt;
&lt;P&gt;Also your Table 2 modified the data. So your posted example is not what you actually have. You should post an example as it actually exists.&lt;/P&gt;
&lt;P&gt;Also your example output has two column headers "metric" which is not acceptable for SAS data sets.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 15:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485195#M287114</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T15:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485207#M287115</link>
      <description>&lt;P&gt;Something like this may get you started.&lt;/P&gt;
&lt;P&gt;First step: save the Excel as CSV file format. That allows use of the INPUT statement which is a tad more flexible than working with Excel files in any of the raw forms. Change the FILENAME statement to point to the location and name of your file. You could also change the name of the data set to something more descriptive than read if you want to.&lt;/P&gt;
&lt;PRE&gt;/* save the excel as CSV*/
filename  ex 'X:\data\example.csv';

data read;
  infile ex dlm=',' dsd truncover;
  /*read a line and hold for parsing*/
  informat Product_id Product_str Metric $15.;
  /* this will hold the date value column headings
     if there may be more than 10 OR always less than
     10 set the value to the maximun number expected
  */
  array d{10};
  informat d1 - d10 mmddyy10.;
  format d1-d10 mmddyy10.;
  informat factor best8.;
  format MetricDate mmddyy10. factor best8.;
  retain d1-d10;
  input Product_id Product_str Metric @;

   /* if first column is blank or Table 1 skip*/
   if Product_id in ("" "Table 1") then do;
      /* reset date to missing*/
      call missing( of d(*));
      input; 
   end;
   else if Product_id = 'Product ID' then do;
      input d1 - d10;
      /* read each of the column headings into a date value*/
      input;
   end;
   else do;
   /*These should be the actual values wanted*/
      do i=1 to dim(d);
         if not missing( d[i]) then do;
            MetricDate= d[i];
            input factor ?? @;
            output;
         end;
      end;
   end;
   keep Product_id Product_str Metric MetricDate factor;
run;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485207#M287115</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-08T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485303#M287116</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;What version of SAS are you using, and on what operating system is it running on?&amp;nbsp; Do you license SAS/ACCESS to PC File Formats?&amp;nbsp; Do you run SAS using SAS Enterprise Guide or some other way?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;I made a small change to your Excel workbook and added 3 named ranges - table1, table2, and table3 - to identify each of the three tables.&amp;nbsp; This assists with the import to SAS.&amp;nbsp; I attached it as "Example_Vince.xlsx".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Here is sample code (SAS running on Windows) to import the 3 tables into SAS:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options validvarname=any validmemname=extend;

libname xl pcfiles path='Example_Vince.xlsx';

proc datasets lib=xl;
  copy in=xl out=work;
    select table1 table2 table3;
run; quit;

title 'Top Left Table';
proc print data=work.table1; run; quit;

title 'Bottom Left Table';
proc print data=work.table2; run; quit;

title 'Right Table';
proc print data=work.table3; run; quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 22:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485303#M287116</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-08-08T22:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485394#M287117</link>
      <description>Thanks Vince,&lt;BR /&gt;&lt;BR /&gt;I am using SAS9.4 version on 32bit OS&lt;BR /&gt;&lt;BR /&gt;In your attached file i did not find three tables. there are only two tables showing which i provided.</description>
      <pubDate>Thu, 09 Aug 2018 10:16:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485394#M287117</guid>
      <dc:creator>nishSAS</dc:creator>
      <dc:date>2018-08-09T10:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need to import tabular type report in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485439#M287118</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Are you using the 32-bit Windows&amp;nbsp;operating system?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Do you license SAS/ACCESS to PC File Formats?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Do you run SAS using SAS Enterprise Guide or some other way?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the purpose of importing, I added 3 named ranges for the 3 rectangular areas that had column headings.&amp;nbsp; There are two small rectangular areas on the right side, and one large one on the left.&amp;nbsp; The import process handles each of these separately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Importing to SAS works best when the objects that you are trying to import resemble SAS tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 12:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-import-tabular-type-report-in-SAS/m-p/485439#M287118</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-08-09T12:34:02Z</dc:date>
    </item>
  </channel>
</rss>

