<?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: SAS Zip Engine Problem - CRC32 Checksum Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842951#M333302</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;7Zip seems to give a clue as to what is happening when I attempt to extract the contents of the modified file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have two copies of the same file in the ZIP file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Interesting.&amp;nbsp; WinZip doesn't show any such thing.&amp;nbsp; I tried deleting the xml components prior to updating them, but then SAS gave me a message that "file is not a zip archive."&amp;nbsp; Let me play with it a bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2022 19:26:35 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2022-11-07T19:26:35Z</dc:date>
    <item>
      <title>SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842913#M333289</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I'm running SAS 9.4 M6 on a Windows Server 2016 Standard (64 bit) machine.&amp;nbsp; I'm trying to update and add some xml files embedded inside an Excel xlsx file (an Excel xlsx file is a Zip archive) in order to update a custom property, a label that marks the file as either "Internal" or "External."&amp;nbsp; If I manually unzip the xlsx file and manually change the embedded xml files using Windows Notepad and then manually re-zip everything, I can a) open xlsx file with Excel, b) the data displays correctly, and c) the Internal/External label works correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;However, if I use the SAS Zip engine to do the very same thing, I a) cannot open the xlsx file with Excel, and b) if I try to use WinZip to read the files, I get CRC32 checksum errors.&amp;nbsp; See screen print.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1667839732962.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77025i861830262869A497/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1667839732962.png" alt="jimbarbour_0-1667839732962.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that SAS is updating the XML but not re-syncing the CRC32 check sums properly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Has anyone encountered something like this before?&amp;nbsp; Is there a way to manually cause SAS to resync all the CRC32 check sums in a Zip archive?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My program is below.&amp;nbsp; You &lt;EM&gt;should&lt;/EM&gt; be able to execute the program on any SAS system, both Unix type and Windows.&amp;nbsp; I have tried running the four xml updates/adds in different order as well as individually one at a time to try to identify if one of the four is the problem, but no combination of changes work when all four are performed.&amp;nbsp; However, if I run any one of the four by itself without running all four, I can open and read the results using WinZip.&amp;nbsp; Something is getting corrupted when multiple operations are performed on a single xlsx file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Specific xml files being updated or added&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;_rels/.rels (update)&lt;/LI&gt;
&lt;LI&gt;docProps/app.xml (update)&lt;/LI&gt;
&lt;LI&gt;docProps/custom.xml (add)&lt;/LI&gt;
&lt;LI&gt;[Content_Types].xml (update)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Detailed Error Messages&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I notice that even files that I am not touching are getting corrupted.&amp;nbsp; To me this would appear to indicate that the SAS Zip engine is not working correctly.&lt;/P&gt;
&lt;PRE&gt;Extracting file: C:\Users\jbarbou6\Documents\SAS\Pgm\Training\Excel_Properties_ODS\Class_3.ZIP
Extracting to "C:\Users\jbarbou6\Documents\SAS\Pgm\Training\Excel_Properties_ODS\Class_3\"
Use Path: yes   Overlay Files: no
Extracting xl\worksheets\sheet1.xml
Extracting xl\sharedStrings.xml
Extracting docProps\core.xml
Extracting xl\styles.xml
Central and local directory mismatch for file "xl/styles.xml" (crc-32 - local: 1148BA33 hex  central: 3E9D0B61 hex).
Extracting docProps\app.xml
Extracting _rels\.rels
Central and local directory mismatch for file "_rels/.rels" (crc-32 - local: 1148BA33 hex  central: 52D5847E hex).
Extracting xl\_rels\workbook.xml.rels
Unable to find the local header for xl\_rels\workbook.xml.rels.
Extracting xl\workbook.xml
Central and local directory mismatch for file "xl/workbook.xml" (crc-32 - local: 721EAEAE hex  central: 4B8E0F38 hex).
Severe Error: Local and central CRC values don't match.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Program&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%Time_Stamp(START);

**	Set slash to back slash for Windows or forward slash for LINUX/UNIX	**;
%LET	Slash		=	%SYSFUNC(IFC(%EVAL(&amp;amp;SYSSCP = WIN),\,/));

*%LET	Iteration	=	0;

%IF	%SYMEXIST(Iteration)	%THEN
	%DO;
		%LET	Iteration	=	%EVAL(&amp;amp;Iteration + 1);
	%END;
%ELSE
	%DO;
		%LET	Iteration	=	1;
	%END;

%PUT	&amp;amp;Nte1  Running Iteration &amp;amp;Iteration;

%LET	Path		=	C:\Users\jbarbou6\Documents\SAS\Pgm\Training\Excel_Properties_ODS;
*%LET	Path		=	I:\commercial\user\jbarbou3\ODS_Excel;
%LET	File_Name	=	&amp;amp;Path.&amp;amp;Slash.Class_&amp;amp;Iteration..xlsx;

**	Create an xlsx file with Proc Export	**;
PROC	EXPORT	DATA=sashelp.class	FILE="&amp;amp;File_Name"	REPLACE	DBMS=xlsx;
RUN;

FILENAME	XL_File	ZIP	"&amp;amp;File_Name";

**------------------------- Relationships --------------------------------**;
**	Read in the .rels relationships file, add a reference to custom.xml, and write out a SAS data set containing the modified .rels xml	**;
DATA	WORK.Rels_XML;
	DROP	_:;
	INFILE	XL_File(_rels/.rels)	LENGTH=SAS_Length;
	INPUT	Line	$VARYING32767.	SAS_Length;
	_Position	=	FIND(Line, '&amp;lt;/relationships&amp;gt;', 'i');
	IF	_Position	THEN
		DO;
			PUTLOG	"&amp;amp;Nte1  Adding custom.xml entry to spreadsheet iteration &amp;amp;Iteration";
			SUBSTR(Line,_Position)	=	'&amp;lt;Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties" Target="docProps/custom.xml"/&amp;gt;&amp;lt;/Relationships&amp;gt;';
		END;
RUN;

**------------------------- Content Types --------------------------------**;
**	Read in the Content Types XML file, add a reference to custom.xml, and write out a SAS data set containing the modified Content Types XML.	**;
DATA	WORK.Content_Types_XML;
	DROP	_:;
	INFILE	XL_File([Content_Types].xml)	LENGTH=SAS_Length;
	INPUT	Line	$VARYING32767.	SAS_Length;
	_Position	=	FIND(Line, '&amp;lt;/Types&amp;gt;', 'i');
	IF	_Position	THEN
		DO;
			PUTLOG	"&amp;amp;Nte1  Adding custom.xml entry to spreadsheet iteration &amp;amp;Iteration";
			SUBSTR(Line,_Position)	=	'&amp;lt;Override PartName="/docProps/custom.xml" ContentType="application/vnd.openxmlformats-officedocument.custom-properties+xml"/&amp;gt;&amp;lt;/Types&amp;gt;';
		END;
RUN;

**--------------------------- Custom.XML --------------------------------**;
**	Create a SAS data set that contains the custom XML that will set the label to either External or Internal	**;
DATA	WORK.Custom_XML;
	INFILE	DATALINES4	LENGTH=SAS_Length;
	INPUT	Line	$VARYING32767.	SAS_Length;
DATALINES4;
&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;
&amp;lt;Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_Enabled"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;true&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="3" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_SetDate"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;2022-11-05T21:48:26Z&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="4" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_Method"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;Privileged&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="5" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_Name"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;External Label&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="6" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_SiteId"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;db05faca-c82a-4b9d-b9c5-0f64b6755421&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="7" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_ActionId"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;6d6ffa67-7505-4457-b8c1-4592fb83e3c9&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="8" name="MSIP_Label_320f21ee-9bdc-4991-8abe-58f53448e302_ContentBits"&amp;gt;&amp;lt;vt:lpwstr&amp;gt;0&amp;lt;/vt:lpwstr&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/Properties&amp;gt;
;;;;
RUN;

**--------------------------- App.XML --------------------------------**;
**	Create a SAS data set that contains the App.XML that will correspond to the rest of the XML	**;
DATA	WORK.App_XML;
	INFILE	DATALINES4	LENGTH=SAS_Length;
	INPUT	Line	$VARYING32767.	SAS_Length;
DATALINES4;
&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;
&amp;lt;Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"&amp;gt;&amp;lt;Application&amp;gt;Microsoft Excel&amp;lt;/Application&amp;gt;&amp;lt;DocSecurity&amp;gt;0&amp;lt;/DocSecurity&amp;gt;&amp;lt;ScaleCrop&amp;gt;false&amp;lt;/ScaleCrop&amp;gt;&amp;lt;HeadingPairs&amp;gt;&amp;lt;vt:vector size="4" baseType="variant"&amp;gt;&amp;lt;vt:variant&amp;gt;&amp;lt;vt:lpstr&amp;gt;Worksheets&amp;lt;/vt:lpstr&amp;gt;&amp;lt;/vt:variant&amp;gt;&amp;lt;vt:variant&amp;gt;&amp;lt;vt:i4&amp;gt;1&amp;lt;/vt:i4&amp;gt;&amp;lt;/vt:variant&amp;gt;&amp;lt;vt:variant&amp;gt;&amp;lt;vt:lpstr&amp;gt;Named Ranges&amp;lt;/vt:lpstr&amp;gt;&amp;lt;/vt:variant&amp;gt;&amp;lt;vt:variant&amp;gt;&amp;lt;vt:i4&amp;gt;1&amp;lt;/vt:i4&amp;gt;&amp;lt;/vt:variant&amp;gt;&amp;lt;/vt:vector&amp;gt;&amp;lt;/HeadingPairs&amp;gt;&amp;lt;TitlesOfParts&amp;gt;&amp;lt;vt:vector size="2" baseType="lpstr"&amp;gt;&amp;lt;vt:lpstr&amp;gt;Class_25&amp;lt;/vt:lpstr&amp;gt;&amp;lt;vt:lpstr&amp;gt;Class_25&amp;lt;/vt:lpstr&amp;gt;&amp;lt;/vt:vector&amp;gt;&amp;lt;/TitlesOfParts&amp;gt;&amp;lt;Company&amp;gt;SAS Institute Inc&amp;lt;/Company&amp;gt;&amp;lt;LinksUpToDate&amp;gt;false&amp;lt;/LinksUpToDate&amp;gt;&amp;lt;SharedDoc&amp;gt;false&amp;lt;/SharedDoc&amp;gt;&amp;lt;HyperlinksChanged&amp;gt;false&amp;lt;/HyperlinksChanged&amp;gt;&amp;lt;AppVersion&amp;gt;16.0300&amp;lt;/AppVersion&amp;gt;&amp;lt;/Properties&amp;gt;
;;;;
RUN;

**	Update/add the XML files to the xlsx file which is a Zip archive	**;
DATA	_NULL_;
	LENGTH	Mem_Name	$128;

	INFILE	DATALINES4;
	INPUT	Mem_Name	$;
	FILE	XL_File	MEMVAR=Mem_Name;
	PUTLOG	"&amp;amp;Nte1  1.  "	_N_=  Mem_Name=;

	IF	Mem_Name	=	'docProps/custom.xml'	THEN
		DO;
			**	Create the custom.xml file from the SAS data set that contains the custom XML that will set the label to either External or Internal	**;
			PUTLOG	"&amp;amp;Nte1  Processing "		Mem_Name;
			DO	UNTIL	(End_Custom);	
				SET	WORK.CUSTOM_XML				END=End_Custom;
				Leng	=	length(line);
				PUT	Line	$Varying32767.		Leng;
			END;
		END;

	IF	Mem_Name	=	'docProps/app.xml'	THEN
		DO;
			**	Create the app.xml file from the SAS data set that contains the App XML	**;
			PUTLOG	"&amp;amp;Nte1  Processing "		Mem_Name;
			DO	UNTIL	(End_App);	
				SET	WORK.App_XML				END=End_App;
				Leng	=	length(line);
				PUT	Line	$Varying32767.		Leng;
			END;
		END;

	IF	Mem_Name	=	'_rels/.rels'			THEN
		DO;
			**	Write the modified .rels xml to the .rels file	**;
			PUTLOG	"&amp;amp;Nte1  Processing "		Mem_Name;
			DO	UNTIL	(End_Rels);
				SET	WORK.Rels_XML				END=End_Rels;
				Leng	=	length(line);
				PUT	Line	$Varying32767.		Leng;
			END;
		END;

	IF	Mem_Name	=	'[Content_Types].xml'	THEN
		DO;
			**	Write the modified Content Types XML to the Content Types XML file	**;
			PUTLOG	"&amp;amp;Nte1  Processing "		Mem_Name;
			DO	UNTIL	(End_Content);
				SET	WORK.Content_Types_XML		END=End_Content;
				Leng	=	length(line);
				PUT	Line	$Varying32767.		Leng;
			END;
		END;

DATALINES4;
_rels/.rels
docProps/custom.xml
docProps/app.xml
[Content_Types].xml
;;;;
RUN;

%Time_Stamp(STOP);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel error message.&lt;/P&gt;
&lt;P&gt;When I try to open the xlsx file with Excel, I receive the following message. Any recovery attempt(s) fail.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_1-1667841453889.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77026i7D046E39B93F6149/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_1-1667841453889.png" alt="jimbarbour_1-1667841453889.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 17:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842913#M333289</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-07T17:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842945#M333298</link>
      <description>&lt;P&gt;Can you recreate the issue with a simpler program?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 18:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842945#M333298</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-07T18:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842949#M333300</link>
      <description>&lt;P&gt;7Zip seems to give a clue as to what is happening when I attempt to extract the contents of the modified file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have two copies of the same file in the ZIP file.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1667848970227.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77038iBF11356111C2FEFB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1667848970227.png" alt="Tom_0-1667848970227.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842949#M333300</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-07T19:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842950#M333301</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Can you recreate the issue with a simpler program?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hmm.&amp;nbsp; Good question.&amp;nbsp; Maybe.&amp;nbsp; I need to have a coordinated set of changes to an Excel file.&amp;nbsp; Of the four updates/adds I'm making, all have to be in place in order for things to work.&amp;nbsp; Just adding, say, the custom.xml does nothing since the Content Types and Rels xml files don't have any pointers to the file.&amp;nbsp; In addition, when I've done an update to just one xml file, it works just fine in terms of the CRC32 check sums.&amp;nbsp; It's something about doing multiple updates to a single Zip archive that is throwing the check sums off (from what I can tell).&amp;nbsp; But this is a good idea.&amp;nbsp; Let me play with it a bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842950#M333301</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-07T19:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842951#M333302</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;7Zip seems to give a clue as to what is happening when I attempt to extract the contents of the modified file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have two copies of the same file in the ZIP file.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Interesting.&amp;nbsp; WinZip doesn't show any such thing.&amp;nbsp; I tried deleting the xml components prior to updating them, but then SAS gave me a message that "file is not a zip archive."&amp;nbsp; Let me play with it a bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842951#M333302</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-07T19:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842953#M333304</link>
      <description>&lt;P&gt;What if you copy the new files into the archive instead?&lt;/P&gt;
&lt;P&gt;If that doesn't fix it then what if you DELETE the old file first?&lt;/P&gt;
&lt;P&gt;If that doesn't fix it then what if you make a whole new archive and copy all of the files there, picking the proper version of each file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 19:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842953#M333304</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-07T19:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842978#M333315</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;What if you copy the new files into the archive instead?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That does work when I copy them in by hand.&amp;nbsp; I haven't tried that using a SAS program.&amp;nbsp; I'm trying to avoid any OS level commands since my program needs to work in both Windows and UNIX type environments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;If that doesn't fix it then what if you DELETE the old file first?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When I've tried deleting the old file first, then SAS gives me a message that "file is not a zip file," and I can't proceed.&amp;nbsp; I could play with this some more though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;/P&gt;
&lt;P&gt;If that doesn't fix it then what if you make a whole new archive and copy all of the files there, picking the proper version of each file?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, that's what I've kind of resigned myself to.&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Extract everything from an xlsx file&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Update all files in unzipped form&lt;/LI&gt;
&lt;LI&gt;Delete the original xlsx file&lt;/LI&gt;
&lt;LI&gt;Create a new xlsx file with the same name as the original xlsx file.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;As I dig a little further, I see that subtle changes are made to &lt;EM&gt;every&lt;/EM&gt; xml file inside an xlsx Zip archive when this Internal/External label is set.&amp;nbsp; When Proc Export with just default settings creates an xlsx file, 10 xml files are created inside.&amp;nbsp; I want to add a custom.xml file, for a total of 11 files.&amp;nbsp; Hard coding all of these xml changes/adds seems like it may not be practical, particularly if the Excel VB code ever changes.&amp;nbsp; I'm going to have to talk to my internal client and see if they can just set the label manually.&amp;nbsp; Given the number of xml files and SAS' seeming difficulty with CRC32 check sums, my approach may not really be workable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've learned one interesting thing here:&amp;nbsp; The use of a MemVar which does essentially for Zip files what a FileVar would do for unzipped files.&amp;nbsp; One should however beware of potential CRC32 check sum errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 21:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/842978#M333315</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-07T21:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843011#M333327</link>
      <description>&lt;P&gt;Further research:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Although &lt;EM&gt;all&lt;/EM&gt; xml files in the xlsx file have&amp;nbsp;some kind of update, really &lt;STRONG&gt;only three&lt;/STRONG&gt;&amp;nbsp;&lt;EM&gt;must&lt;/EM&gt; be updated/added to set the label:
&lt;OL&gt;
&lt;LI&gt;custom.xml (add)&lt;/LI&gt;
&lt;LI&gt;[Content_Types].xml (update)&lt;/LI&gt;
&lt;LI&gt;_rels/.rels (update)&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Adding custom.xml works just fine, but &lt;EM&gt;updating&lt;/EM&gt; either&amp;nbsp;[Content_Types].xml or&amp;nbsp;_rels/.rels causes&amp;nbsp;&lt;EM&gt;other&lt;/EM&gt; xml files to become corrupted, typically in the xl folder.&amp;nbsp; Interestingly, when I update either&amp;nbsp;[Content_Types].xml or&amp;nbsp;_rels/.rels, the updates themselves work fine.&amp;nbsp; It is&amp;nbsp;&lt;EM&gt;other&lt;/EM&gt; xml files that get corrupted.&lt;/LI&gt;
&lt;LI&gt;I tried deleting&amp;nbsp;[Content_Types].xml (or&amp;nbsp;_rels/.rels) before updating, but if I delete them before updating, the update Data step can't open the xlsx file.&amp;nbsp; SAS says "The filename I:\commercial\user\jbarbou3\ODS_Excel\Class_17.xlsx &lt;STRONG&gt;is not a zip file&lt;/STRONG&gt;".&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Pretty stuck here.&amp;nbsp; I wonder if&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;might be able to help a poor soul out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Synopsis:&amp;nbsp; I'm trying to update/add the three above listed xml files in an xlsx file.&amp;nbsp; The add works fine, but either or both of the two updates causes corruption in&amp;nbsp;&lt;EM&gt;other&lt;/EM&gt; xml files inside the xlsx, files that I haven't touched.&amp;nbsp; Any tips here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 23:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843011#M333327</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-07T23:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843029#M333334</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;,&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to create a work-around that a) created the custom Excel properties I originally sought and b) doesn't have the CRC-32 check sum errors that using the SAS Zip engine causes.&amp;nbsp; In the event this is of interest, read on.&amp;nbsp; I'll eventually post SAS code for those who might be interested -- once I clean things up a bit and package it into a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:
&lt;BLOCKQUOTE&gt;
&lt;P&gt;If that doesn't fix it then what if you make a whole new archive and copy all of the files there, picking the proper version of each file?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yeah, that's what I've kind of resigned myself to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Extract everything from an xlsx file&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Update all files in unzipped form&lt;/LI&gt;
&lt;LI&gt;&lt;STRIKE&gt;Delete the original xlsx file&lt;/STRIKE&gt;&lt;/LI&gt;
&lt;LI&gt;Create a new xlsx file with the same name as the original xlsx file.&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I was able work-around the Zip engine invalid CRC-32 problem by doing steps 1, 2, and 4 of the steps listed above.&amp;nbsp; Rather than delete the original xlsx file, I just create a new xlsx file using ODS Package.&amp;nbsp; I presume that ODS Package overlays the original xlsx file.&amp;nbsp; By using ODS Package, I can now open the resultant xlsx file with Excel, the contents display correctly, and the Internal/External label custom property is set.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm going to leave this topic unsolved for a bit longer in case&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;has a solution for the Zip engine problem so others don't have to resort to my somewhat kludgey work-around.&amp;nbsp; It's a bit of coding to get the work-around in place.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I clean up my spaghetti and turn it into a macro, I'll post the SAS code in the original thread,&amp;nbsp;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-with-Custom-Property-Names/m-p/842420#M26004" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-with-Custom-Property-Names/m-p/842420#M26004&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for all the help and ideas,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 05:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843029#M333334</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-08T05:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843100#M333351</link>
      <description>&lt;P&gt;I don't have a better approach. Glad you got it solved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can generalize the issue to "using the FILENAME ZIP to update/replace a member will corrupt the zip file", then I'd pursue with Tech Support. If it's specific to updating XLSX files only, then I suspect the answer will be "well, only Microsoft apps can be expected to understand all of the mysteries of editing XSLX files in place..."&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 13:01:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843100#M333351</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-11-08T13:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843177#M333364</link>
      <description>&lt;P&gt;Hi, Chris,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp; I'll have to see if I can replicate the problem.&amp;nbsp; It does however seem to be a Zip engine issue inasmuch as I'm just making text based edits to a zip archive.&amp;nbsp; WinZip, which presumably knows nothing of Microsoft Excel's inner mysteries, handles things just fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Right now, I've got to get a Production version of this working.&amp;nbsp; Hopefully I can experiment more later this week.&amp;nbsp; It's a very odd problem that the files that I'm&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt; changing are the ones that are getting corrupted.&amp;nbsp; I suspect it's the inner mysteries of multi-directory Zip archives more than it is the inner mysteries of Excel, but we'll see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking the time to respond,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843177#M333364</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-08T16:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Zip Engine Problem - CRC32 Checksum Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843298#M333399</link>
      <description>&lt;P&gt;If it were of interest, I've added code (bundled up into a macro) for my work around for the CRC-32 check sum errors I encountered when using the Zip engine in the original thread:&amp;nbsp;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-with-Custom-Property-Names/td-p/842420/page/2" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-with-Custom-Property-Names/td-p/842420/page/2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 07:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Zip-Engine-Problem-CRC32-Checksum-Error/m-p/843298#M333399</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2022-11-09T07:50:27Z</dc:date>
    </item>
  </channel>
</rss>

