<?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: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900397#M83061</link>
    <description>&lt;P&gt;Then I would try to replace PROC COPY with a simple DATA step, or use PROC EXPORT to create the sheet.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2023 20:06:17 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-10-27T20:06:17Z</dc:date>
    <item>
      <title>Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900336#M83058</link>
      <description>&lt;P&gt;I have a general macro that is copying data sets from a library to workbook.&lt;/P&gt;&lt;PRE&gt;libname workbook xlsx 'c:\temp\sample.xlsx';
proc sort data=sashelp.class out=work;
  by name;
run;
proc copy in=work out=workbook;
 select class;
run;&lt;/PRE&gt;&lt;P&gt;Will log&lt;/P&gt;&lt;PRE&gt;NOTE: Copying WORK.CLASS to WORKBOOK.CLASS (memtype=DATA).
&lt;FONT color="#FF6600"&gt;WARNING: Engine XLSX does not support SORTEDBY operations.  SORTEDBY information cannot be copied.&lt;/FONT&gt;
NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: The data set WORKBOOK.CLASS has 19 observations and 5 variables.
NOTE: The export data set has 19 observations and 5 variables.
NOTE: PROCEDURE COPY used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds&lt;/PRE&gt;&lt;P&gt;I really don't care about this and would like to prevent the WARNING: because a log checker program further in the system will do all sorts of alerts on any kind of warning.&amp;nbsp; The ecosystem I'm in does not allow for alteration the data sets, nor copying them to a different location (to remove the SORTEDBY meta data) before copying to workbook.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 15:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900336#M83058</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2023-10-27T15:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900341#M83059</link>
      <description>&lt;P&gt;Use the COPY statement in PROC DATASETS, and specify the NOWARN option in the PROC statement.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 15:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900341#M83059</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-27T15:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900392#M83060</link>
      <description>&lt;P&gt;Unfortunately, the answer sounded good but turns out to be incorrect for the question at hand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From Proc DATASETS documentation&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;NOWARN&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;suppresses the warning when used with the FORCE option to concatenate two data sets with different variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, from Proc DATASETS, COPY Statement documentation&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Using the COPY Procedure Instead of the COPY Statement&lt;P class=""&gt;Generally, the COPY procedure functions the same as the COPY statement in the DATASETS procedure. Here is a list of differences:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The IN= argument is required with PROC COPY. In the COPY statement, IN= is optional. If omitted, the default value is the libref of the procedure input library.&lt;/LI&gt;&lt;LI&gt;PROC DATASETS cannot work with libraries that allow only sequential data access.&lt;/LI&gt;&lt;LI&gt;The COPY statement honors the NOWARN option but PROC COPY does not.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is no NOWARN option for the COPY statement, so I guess the doc is referring to the NOWARN of the DATASETS proc.&lt;/P&gt;&lt;P&gt;Regardless, the sample code here also logs WARNINGs despite using the option NOWARN.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;libname workbook xlsx "c:\temp\sample.xlsx";

proc sort data=sashelp.class out=work.class; by name;
proc sort data=sashelp.cars  out=work.cars;  by msrp;
run;
proc datasets nolist nowarn lib=work ;
  copy out=workbook ;
  select class cars ;
run;
quit;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;137673  proc sort data=sashelp.class out=work.class; by name;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


137674  proc sort data=sashelp.cars  out=work.cars;  by msrp;
137675  run;

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: The data set WORK.CARS has 428 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


137676  proc datasets nolist nowarn lib=work ;
137677    copy out=workbook ;
137678    select class cars ;
137679  run;

NOTE: Copying WORK.CLASS to WORKBOOK.CLASS (memtype=DATA).
WARNING: Engine XLSX does not support SORTEDBY operations.  SORTEDBY information cannot be copied.
NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: The data set WORKBOOK.CLASS has 19 observations and 5 variables.
NOTE: The export data set has 19 observations and 5 variables.
NOTE: Copying WORK.CARS to WORKBOOK.CARS (memtype=DATA).
WARNING: Engine XLSX does not support SORTEDBY operations.  SORTEDBY information cannot be copied.
NOTE: There were 428 observations read from the data set WORK.CARS.
NOTE: The data set WORKBOOK.CARS has 428 observations and 15 variables.
NOTE: The export data set has 428 observations and 15 variables.
137680  quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.08 seconds
      cpu time            0.00 seconds&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 18:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900392#M83060</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2023-10-27T18:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900397#M83061</link>
      <description>&lt;P&gt;Then I would try to replace PROC COPY with a simple DATA step, or use PROC EXPORT to create the sheet.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2023 20:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900397#M83061</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-10-27T20:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900423#M83062</link>
      <description>&lt;P&gt;Try option SORTEDBY=NULL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname workbook xlsx 'c:\temp\sample.xlsx';
proc sort data=sashelp.class out=class(sortedby=_null_);
  by name;
run;
proc copy in=work out=workbook;
 select class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Oct 2023 09:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900423#M83062</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-10-28T09:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900426#M83063</link>
      <description>&lt;P&gt;The SORTEDBY metadata for your dataset WORK is not inherited if you make a copy of work.&amp;nbsp; So apply PROC COPY to that dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname workbook xlsx 'c:\temp\sample.xlsx';
proc sort data=sashelp.class out=work;
  by name;
run;

data workview/ view=workview;
  set work;
run;


proc copy in=workview out=workbook;
 select class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 28 Oct 2023 12:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900426#M83063</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2023-10-28T12:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc COPY, can you prevent WARNING: Engine XLSX does not support SORTEDBY operations</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900509#M83066</link>
      <description>&lt;P&gt;You could sort directly into the workbook.&amp;nbsp; Then you get only a NOTE and not a WARNING.&lt;/P&gt;
&lt;PRE&gt;1    libname workbook xlsx 'c:\downloads\sample.xlsx';
NOTE: Libref WORKBOOK was successfully assigned as follows:
      Engine:        XLSX
      Physical Name: c:\downloads\sample.xlsx
2    proc sort data=sashelp.class out=workbook.class;
3      by name;
4    run;

NOTE: The XLSX engine does not support setting a sort indicator. The physical order of observations might not be preserved.
NOTE: Sort indicator cannot be set on WORKBOOK.class.DATA.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORKBOOK.class has 19 observations and 5 variables.
NOTE: The export data set has 19 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;To eliminate all of the notes just use a DATA step instead of a PROC to write to the workbook.&lt;/P&gt;
&lt;PRE&gt;1    libname workbook xlsx 'c:\downloads\sample.xlsx';
NOTE: Libref WORKBOOK was successfully assigned as follows:
      Engine:        XLSX
      Physical Name: c:\downloads\sample.xlsx
2    proc sort data=sashelp.class out=class;
3      by name;
4    run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


5    data workbook.class; set class; run;

NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: The data set WORKBOOK.class has 19 observations and 5 variables.
NOTE: The export data set has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds
&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Oct 2023 18:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-COPY-can-you-prevent-WARNING-Engine-XLSX-does-not-support/m-p/900509#M83066</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-29T18:16:13Z</dc:date>
    </item>
  </channel>
</rss>

