<?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: Limit by ERRORS= , special intention. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709028#M217936</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as mentioned, I rerun my code with adding the MSGLEVEL=I, the code and LOG are as below:&lt;/P&gt;
&lt;P&gt;CODE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options compress=yes reuse=yes;
options MSGLEVEL=I;

%macro ImportAndTranspose(
      File=
      , StartSheet=
      , EndSheet=
   );
   
   %local i;
   
   %do i = &amp;amp;StartSheet. %to &amp;amp;EndSheet.;
      proc import datafile= "&amp;amp;File." 
                  out= sheet&amp;amp;i.
                  dbms= xlsx 
                  replace;
          range= "Sheet&amp;amp;i.$A:AG";
          getnames= yes;
      run;
      
      proc sort data= sheet&amp;amp;i.;
      by Type;
      run;

      proc transpose data= sheet&amp;amp;i. 
            out= sheet&amp;amp;i._out(rename=(COL1=s&amp;amp;i. _NAME_=Year) drop=_label_);
         by Type;
         VAR '1988'N - '2019'N;
      run;
	  proc print data=sheet&amp;amp;i._out;
	  run;

      DATA sheet&amp;amp;i._outx;
      set sheet&amp;amp;i._out;

      if s&amp;amp;i. not in: ('NA', '$$') then s&amp;amp;i.2=input(s&amp;amp;i., 32.);
	  drop s&amp;amp;i.;
      run;

   %end;
   
%mend;

%ImportAndTranspose(
      File= C:\Users\pnguyen\Desktop\Argentina.xlsx
      , StartSheet= 2
      , EndSheet= 4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;LOG:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: VARCHAR data type is not supported by the V9 engine. Variable Type has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1988 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1989 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1990 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1991 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1992 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1993 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1994 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1995 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1996 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1997 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1998 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1999 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2000 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2001 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2002 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2003 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2004 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2005 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2006 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2007 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2008 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2009 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2010 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2011 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2012 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2013 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2014 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2015 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2016 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2017 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2018 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2019 has been converted to CHAR data type.
NOTE: The import data set has 453 observations and 33 variables.
NOTE: Compressing data set WORK.SHEET2 decreased size by 66.67 percent. 
      Compressed is 1 pages; un-compressed would require 3 pages.
NOTE: WORK.SHEET2 data set was successfully created.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 02 Jan 2021 01:06:05 GMT</pubDate>
    <dc:creator>Phil_NZ</dc:creator>
    <dc:date>2021-01-02T01:06:05Z</dc:date>
    <item>
      <title>Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709020#M217928</link>
      <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;I face a common problem that I saw the notice below in my data when trying to convert from character to numeric type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid argument to function INPUT at line 49 column 5.&lt;BR /&gt;Type=134495 Year=1992 s2=NA s22=. _ERROR_=1 _N_=133&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line 49 column 5.&lt;BR /&gt;Type=134495 Year=1993 s2=NA s22=. _ERROR_=1 _N_=134&lt;BR /&gt;NOTE: Invalid argument to function INPUT at line 49 column 5.&lt;BR /&gt;Type=134625 Year=1988 s2=NA s22=. _ERROR_=1 _N_=161&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
Type=134625 Year=1989 s2=NA s22=. _ERROR_=1 _N_=162&lt;BR /&gt;
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to 
      missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      3309 at 49:5 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My code is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA sheet2_outx;
set sheet2_out;
s22=input(s2,32.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My data sheet2_out simply is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Type    Year    s2
131566	1988	$$ER: E100,NO WORLDSCOPE DATA FOR THIS CODE
131566	1989	
131566	1990	
131566	1991	
131566	1992	
131566	1993	
131566	1994	
131566	1995	
131566	1996	
131566	1997	
131566	1998	
131566	1999	
131566	2000	
131566	2001	
131566	2002	
131566	2003	
131566	2004	
131566	2005	
131566	2006	
131566	2007	
131566	2008	
131566	2009	
131566	2010	
131566	2011	
131566	2012	
131566	2013	
131566	2014	
131566	2015	
131566	2016	
131566	2017	
131566	2018	
131566	2019	
131879	1988	NA
131879	1989	NA
131879	1990	NA
131879	1991	NA
131879	1992	NA
131879	1993	NA
131879	1994	NA
131879	1995	NA
131879	1996	NA
131879	1997	3642572
131879	1998	3843093&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And the output sheet2_outx is that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Type    Year    s2      s22                                                                                                                                                            
131566	1988	$$ER: E100,NO WORLDSCOPE DATA FOR THIS CODE	.
131566	1989		    .
131566	1990		    .
131566	1991		    .
131566	1992		    .
131566	1993		    .
131566	1994		    .
131566	1995		    .
131566	1996		    .
131566	1997		    .
131566	1998		    .
131566	1999		    .
131566	2000		    .
131566	2001		    .
131566	2002		    .
131566	2003		    .
131566	2004		    .
131566	2005		    .
131566	2006		    .
131566	2007		    .
131566	2008		    .
131566	2009		    .
131566	2010		    .
131566	2011		    .
131566	2012		    .
131566	2013		    .
131566	2014		    .
131566	2015		    .
131566	2016		    .
131566	2017		    .
131566	2018		    .
131566	2019		    .
131879	1988	NA	    .
131879	1989	NA	    .
131879	1990	NA	    .
131879	1991	NA	    .
131879	1992	NA	    .
131879	1993	NA	    .
131879	1994	NA	    .
131879	1995	NA	    .
131879	1996	NA	    .
131879	1997	3642572	3642572
131879	1998	3843093	3843093&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;What I want is to convert the variable s2 (characteric variable) to s22 (numeric variable), and all hash observation &lt;FONT color="#000000"&gt;(e.g:&lt;CODE class=" language-sas"&gt;$$ER: E100,NO WORLDSCOPE DATA FOR THIS CODE	)&amp;nbsp;&lt;/CODE&gt;&lt;/FONT&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;CODE class=" language-sas"&gt;and&amp;nbsp;NA,&amp;nbsp;and blanks and&amp;nbsp;other&amp;nbsp;words&amp;nbsp;to&amp;nbsp;missing&amp;nbsp;variable&amp;nbsp;".".&lt;/CODE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;CODE class=" language-sas"&gt;So,&amp;nbsp;due&amp;nbsp;to&amp;nbsp;such&amp;nbsp;an&amp;nbsp;intention,&amp;nbsp;whether I&amp;nbsp;do&amp;nbsp;not&amp;nbsp;need&amp;nbsp;to&amp;nbsp;care&amp;nbsp;about&amp;nbsp;the&amp;nbsp;ERROR&amp;nbsp;message&amp;nbsp;in&amp;nbsp;this&amp;nbsp;situation?&lt;/CODE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;CODE class=" language-sas"&gt;Many&amp;nbsp;thanks&amp;nbsp;and&amp;nbsp;warmest&amp;nbsp;regards.&lt;/CODE&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;P/S: I also attach my sheet2_out dataset in case it facilitate your investigation.&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Jan 2021 21:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709020#M217928</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-01T21:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709021#M217929</link>
      <description>&lt;P&gt;If you are getting the desired result you can suppress the notes in the log by adding a double question mark like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA sheet2_outx;
set sheet2_out;
s22=input(s2,?? 32.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jan 2021 21:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709021#M217929</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-01T21:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709022#M217930</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure the code I ran and the results as well as the WARNING shown are compatible with my intention mentioned above?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I knew about the ??, which is a kind of suppression of the OPTION, but I am reluctant to use it because it may hide some warnings that may affect the whole results then. I am wondering "??" is mainly used by the person who is quite confident about their data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 22:09:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709022#M217930</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-01T22:09:27Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709023#M217931</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212695"&gt;@Phil_NZ&lt;/a&gt;&amp;nbsp; - The way you have coded it appears to meet your intention. Alternatively you could code for specific values like NA so that unexpected values still produce log notes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA sheet2_outx;
set sheet2_out;
if S2 not in: ('NA', '$$') then s22=input(s2, 32.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jan 2021 22:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709023#M217931</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-01T22:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709024#M217932</link>
      <description>&lt;P&gt;Perhaps you only want to suppress the warning for expected values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA sheet2_outx;
  set sheet2_out;
  if s2 not in ('NA' ' ') then  s22=input(s2,32.);
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 00:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709024#M217932</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-02T00:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709025#M217933</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the data attached below, when importing, I face the common suggestion :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with 
      options MSGLEVEL=I&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you have a look at my dataset and suggest to me how to deal with this NOTE.&lt;/P&gt;
&lt;P&gt;My code is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro ImportAndTranspose(
      File=
      , StartSheet=
      , EndSheet=
   );
   
   %local i;
   
   %do i = &amp;amp;StartSheet. %to &amp;amp;EndSheet.;
      proc import datafile= "&amp;amp;File." 
                  out= sheet&amp;amp;i.
                  dbms= xlsx 
                  replace;
          range= "Sheet&amp;amp;i.$A:AG";
          getnames= yes;
      run;
      
      proc sort data= sheet&amp;amp;i.;
      by Type;
      run;

      proc transpose data= sheet&amp;amp;i. 
            out= sheet&amp;amp;i._out(rename=(COL1=s&amp;amp;i. _NAME_=Year) drop=_label_);
         by Type;
         VAR '1988'N - '2019'N;
      run;
	  proc print data=sheet&amp;amp;i._out;
	  run;

      DATA sheet&amp;amp;i._outx;
      set sheet&amp;amp;i._out;

      if s&amp;amp;i. not in: ('NA', '$$') then s&amp;amp;i.2=input(s&amp;amp;i., 32.);
	  drop s&amp;amp;i.;
      run;

   %end;
   
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks !&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2021 22:53:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709025#M217933</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-01T22:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709026#M217934</link>
      <description>&lt;P&gt;That is just a bug in PROC IMPORT, it shouldn't really be issuing that note as it is not an unexpected issue.&amp;nbsp; SAS datasets only support fixed length character strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps whoever wrote the code at SAS did not realize it would be used in BASE SAS instead of VIYA?&amp;nbsp; It is not uncommon for large complex code projects for programmers to not fully understand all of the nuances of the system.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 00:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709026#M217934</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-02T00:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709027#M217935</link>
      <description>&lt;P&gt;Can you set MSGLEVEL = I, rerun and post the log please? As a general rule I won't copy spreadsheets off the internet for security reasons.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 00:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709027#M217935</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-02T00:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709028#M217936</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as mentioned, I rerun my code with adding the MSGLEVEL=I, the code and LOG are as below:&lt;/P&gt;
&lt;P&gt;CODE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options compress=yes reuse=yes;
options MSGLEVEL=I;

%macro ImportAndTranspose(
      File=
      , StartSheet=
      , EndSheet=
   );
   
   %local i;
   
   %do i = &amp;amp;StartSheet. %to &amp;amp;EndSheet.;
      proc import datafile= "&amp;amp;File." 
                  out= sheet&amp;amp;i.
                  dbms= xlsx 
                  replace;
          range= "Sheet&amp;amp;i.$A:AG";
          getnames= yes;
      run;
      
      proc sort data= sheet&amp;amp;i.;
      by Type;
      run;

      proc transpose data= sheet&amp;amp;i. 
            out= sheet&amp;amp;i._out(rename=(COL1=s&amp;amp;i. _NAME_=Year) drop=_label_);
         by Type;
         VAR '1988'N - '2019'N;
      run;
	  proc print data=sheet&amp;amp;i._out;
	  run;

      DATA sheet&amp;amp;i._outx;
      set sheet&amp;amp;i._out;

      if s&amp;amp;i. not in: ('NA', '$$') then s&amp;amp;i.2=input(s&amp;amp;i., 32.);
	  drop s&amp;amp;i.;
      run;

   %end;
   
%mend;

%ImportAndTranspose(
      File= C:\Users\pnguyen\Desktop\Argentina.xlsx
      , StartSheet= 2
      , EndSheet= 4);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;LOG:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: VARCHAR data type is not supported by the V9 engine. Variable Type has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1988 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1989 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1990 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1991 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1992 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1993 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1994 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1995 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1996 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1997 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1998 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 1999 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2000 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2001 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2002 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2003 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2004 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2005 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2006 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2007 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2008 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2009 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2010 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2011 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2012 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2013 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2014 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2015 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2016 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2017 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2018 has been converted to CHAR data type.
NOTE: VARCHAR data type is not supported by the V9 engine. Variable 2019 has been converted to CHAR data type.
NOTE: The import data set has 453 observations and 33 variables.
NOTE: Compressing data set WORK.SHEET2 decreased size by 66.67 percent. 
      Compressed is 1 pages; un-compressed would require 3 pages.
NOTE: WORK.SHEET2 data set was successfully created.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 02 Jan 2021 01:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709028#M217936</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-01-02T01:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Limit by ERRORS= , special intention.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709030#M217937</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/212695"&gt;@Phil_NZ&lt;/a&gt;&amp;nbsp; - Looks like Excel is interpreting those columns as VARCHAR and SAS can only handle CHAR and NUM. Your data will still import OK and you could just ignore the notes. To gain more control on your import you could consider saving the Excel sheet as a CSV then you will be able to enforce data type rules and bypass Excel anarchy.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2021 02:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limit-by-ERRORS-special-intention/m-p/709030#M217937</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-02T02:04:30Z</dc:date>
    </item>
  </channel>
</rss>

