<?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: import excel option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325934#M72544</link>
    <description>&lt;P&gt;Then I'd strongly recommend you download the SAS University Edition and install it, so you can test your codes and see what happens.&lt;/P&gt;
&lt;P&gt;The time when programming was taught with paper and pen is gone for &amp;gt; 40 years now.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2017 11:40:20 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-01-19T11:40:20Z</dc:date>
    <item>
      <title>import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325675#M72464</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;I hope somebody could help me.&lt;/P&gt;&lt;P&gt;In a sas code there is a part where an excel file is imported, but I don't understand the logic code very well:&lt;/P&gt;&lt;P&gt;The file imported (called A) has 1 sheet (called B) with 4 colums (col1, col2, col3, col4).&lt;/P&gt;&lt;P&gt;The code that I don't understand is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%import_to_excel (path = &amp;amp;path_map., file = A , sheet = B, ds_out = B);

data A1 (drop= fmtname2 COLUMN4 default
 					rename=(COLUMN3=label fmtname1=fmtname))
	 A2 (drop= fmtname1 COLUMN3
 					rename=(COLUMN4=label fmtname2=fmtname));

	set B (rename= (COLUMN1=start COLUMN2=end) );	
	retain fmtname1 'formobs' fmtname2 'formrat' type 'n' eexcl 'Y' default 4;

run;
%rcSet(&amp;amp;syserr);

proc format cntlin=A1;
run;
%rcSet(&amp;amp;syserr);
 
 proc format cntlin=A2;
run;
%rcSet(&amp;amp;syserr);&lt;/PRE&gt;&lt;P&gt;I need that somebody explain to me what appen when file excel is imported and also what kind of trasformation is done with the column 1, 2, 3 e 4? Are all used for a calculation? Or only column 1 and 2 are considered?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325675#M72464</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-18T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325678#M72465</link>
      <description>&lt;P&gt;There is nothing in the code you have presented which has nything to do with importing files? &amp;nbsp;All it does is copy B to A1 and A2 and add some extra variables and then create a format catalog from A1 and A2&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325678#M72465</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-18T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325681#M72467</link>
      <description>&lt;P&gt;No calculations are done. The contents of sheet B are used as definition files for two numeric formats (formobs. and formrat.).&lt;/P&gt;
&lt;P&gt;The dataset B (imported from Excel, as I guess) has two format definitions side-by-side. The data step splits that vertically into two datasets, one from the columns 1&amp;amp;3, the other from columns 2&amp;amp;4. Both datasets contain the same columns due to the respective drop= and rename= dataset options.&lt;/P&gt;
&lt;P&gt;These datasets now have a structure that allows their use as input files for proc format.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325681#M72467</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T14:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325687#M72469</link>
      <description>&lt;P&gt;Thank you for the answer, but I don't understand:&lt;/P&gt;&lt;PRE&gt;set B (rename= (COLUMN1=start COLUMN2=end) );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;means that only the column 1 and 2 are used? so if I change the values in column 3 or 4 nothing changes?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325687#M72469</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-18T14:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325688#M72470</link>
      <description>&lt;P&gt;No. The columns that are used in the rename= dataset option are renamed, all others stay untouched and will "arrive" in the data step as they are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simply execute the code for testing. As all results are stored in your temporary WORK, no harm can be done.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:43:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325688#M72470</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T14:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325691#M72471</link>
      <description>&lt;P&gt;Ok,&lt;/P&gt;&lt;P&gt;1) so if I change some values in the excel in the column 3, something changes after the import.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&amp;nbsp;after the code&lt;/P&gt;&lt;PRE&gt;rename=(COLUMN3=label fmtname1=fmtname))&lt;/PRE&gt;&lt;P&gt;if now I want to know how and where the column3 is used, what name of it I have to search in the code?&lt;/P&gt;&lt;P&gt;What does the code do there?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325691#M72471</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-18T14:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325697#M72476</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data
  A1 (
    drop=fmtname2 COLUMN4 default
    rename=(COLUMN3=label fmtname1=fmtname)
  )
  A2 (
    drop=fmtname1 COLUMN3
    rename=(COLUMN4=label fmtname2=fmtname)
  )
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In both datasets, label and fmtname will be present.&lt;/P&gt;
&lt;P&gt;In dataset A1, they are built from column3 (imported from Excel) and fmtname1 (set in the data step).&lt;/P&gt;
&lt;P&gt;In dataset A2, they are built from column4 (imported from Excel) and fmtname2 (set in the data step).&lt;/P&gt;
&lt;P&gt;The respective unused variables are dropped from either dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 14:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325697#M72476</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T14:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325703#M72480</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;If excel sheet is composed in this way:&lt;/P&gt;&lt;P&gt;COLUMN1 &amp;nbsp; &amp;nbsp;COLUMN2 &amp;nbsp; &amp;nbsp; &amp;nbsp;COLUMN3 &amp;nbsp; &amp;nbsp; &amp;nbsp;COLUMN4&lt;/P&gt;&lt;P&gt;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0,0003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0,0002 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;0,0003 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0,0050 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0,0024 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you say to me what are the columns and the values in both dataset created?&lt;/P&gt;&lt;P&gt;I'm not a programmer so I need detailed explication.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 15:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325703#M72480</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-18T15:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325743#M72492</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"Simply execute the code for testing".. what is tested?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 17:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325743#M72492</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-18T17:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325777#M72496</link>
      <description>&lt;P&gt;Run the code and see for yourself. Or do you not have SAS at your disposal?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2017 19:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325777#M72496</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-18T19:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325926#M72542</link>
      <description>exactly</description>
      <pubDate>Thu, 19 Jan 2017 10:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325926#M72542</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-19T10:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325934#M72544</link>
      <description>&lt;P&gt;Then I'd strongly recommend you download the SAS University Edition and install it, so you can test your codes and see what happens.&lt;/P&gt;
&lt;P&gt;The time when programming was taught with paper and pen is gone for &amp;gt; 40 years now.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 11:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325934#M72544</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-19T11:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325939#M72545</link>
      <description>&lt;P&gt;So this is what happens when your example code with example data is run:&lt;/P&gt;
&lt;P&gt;The code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data b;
input column1 column2 column3 column4;
cards;
0 0.0003 0.0002 2
0.0003 0.0050 0.0024 5
;
run;

data
  a1 (
    drop=fmtname2 column4 default
    rename=(column3=label fmtname1=fmtname)
  )
  a2 (
    drop=fmtname1 column3
    rename=(column4=label fmtname2=fmtname)
  )
;
set b (rename=(column1=start column2=end));
retain fmtname1 'formobs' fmtname2 'formrat' type 'n' eexcl 'Y' default 4;
run;

proc print data=a1 noobs;
run;
proc print data=a2 noobs;
run;

proc format cntlin=a1;
run;
 
proc format cntlin=a2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log:&lt;/P&gt;
&lt;PRE&gt;16         data b;
17         input column1 column2 column3 column4;
18         cards;

NOTE: The data set WORK.B has 2 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      
21         ;

22         run;
23         
24         data
25           a1 (
26             drop=fmtname2 column4 default
27             rename=(column3=label fmtname1=fmtname)
28           )
29           a2 (
30             drop=fmtname1 column3
31             rename=(column4=label fmtname2=fmtname)
32           )
33         ;
34         set b (rename=(column1=start column2=end));
35         retain fmtname1 'formobs' fmtname2 'formrat' type 'n' eexcl 'Y' default 4;
36         run;

NOTE: There were 2 observations read from the data set WORK.B.
NOTE: The data set WORK.A1 has 2 observations and 6 variables.
NOTE: The data set WORK.A2 has 2 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.02 seconds
      

37         
38         proc print data=a1 noobs;
39         run;

NOTE: There were 2 observations read from the data set WORK.A1.
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

40         proc print data=a2 noobs;
41         run;

NOTE: There were 2 observations read from the data set WORK.A2.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

42         
43         proc format cntlin=a1;
NOTE: Format FORMOBS has been output.
44         run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
NOTE: There were 2 observations read from the data set WORK.A1.

45         
46         proc format cntlin=a2;
NOTE: Format FORMRAT has been output.
47         run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
NOTE: There were 2 observations read from the data set WORK.A2.
&lt;/PRE&gt;
&lt;P&gt;I added two proc print's, so here is the output from them:&lt;/P&gt;
&lt;PRE&gt;      start     end     label    fmtname    type    eexcl

      .0000    .0003    .0002    formobs     n        Y  
      .0003    .0050    .0024    formobs     n        Y  

 start     end     label    fmtname    type    eexcl    default

 .0000    .0003      2      formrat     n        Y         4   
 .0003    .0050      5      formrat     n        Y         4   
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 11:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325939#M72545</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-19T11:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325962#M72546</link>
      <description>&lt;P&gt;Thank you for your help KurtBremser.&lt;/P&gt;&lt;P&gt;I can't resolve my doubt because I don't have complete vision about that code, but you helped me for what I wrote.&lt;/P&gt;&lt;P&gt;Thank you so much! Have a good day &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 13:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325962#M72546</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-19T13:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325996#M72554</link>
      <description>&lt;P&gt;Besides installing SAS UE (which might no be trivial, depending on your computer) I can recommend studying the &lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#n13roklnfoocgin1dom3okvctnvi.htm" target="_blank"&gt;data step principles&lt;/A&gt;, the &lt;A href="http://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#titlepage.htm" target="_blank"&gt;dataset options&lt;/A&gt; (mainly drop, keep, rename and where), the &lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#p0t2ac0tfzcgbjn112mu96hkgg9o.htm" target="_blank"&gt;retain&lt;/A&gt; statement, and &lt;A href="https://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#p1xidhqypi0fnwn1if8opjpqpbmn.htm" target="_blank"&gt;proc format&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This should help in understanding what the elements in your code do.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2017 15:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/325996#M72554</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-19T15:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: import excel option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/326045#M72567</link>
      <description>Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 19 Jan 2017 16:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/import-excel-option/m-p/326045#M72567</guid>
      <dc:creator>twisme</dc:creator>
      <dc:date>2017-01-19T16:47:19Z</dc:date>
    </item>
  </channel>
</rss>

