<?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: Cross-plattform archive transfer / SAS Portal in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Cross-plattform-archive-transfer-SAS-Portal/m-p/418543#M19950</link>
    <description>&lt;P&gt;Hello everyone. I have been faced almost with this issue about two years ago and I can't solve it yet.&lt;/P&gt;&lt;P&gt;As well as the TS, I can't use .zip archive (or any other archive) with appsrv_header function. Result file is corrupt and I can't open it.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 18:13:41 GMT</pubDate>
    <dc:creator>Ujinn_Dave</dc:creator>
    <dc:date>2017-12-05T18:13:41Z</dc:date>
    <item>
      <title>Cross-plattform archive transfer / SAS Portal</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Cross-plattform-archive-transfer-SAS-Portal/m-p/369917#M18854</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a problem regarding file transfer via SAS Portal between plattforms. It´s a quite simple Task:&lt;/P&gt;
&lt;P&gt;The user presses a button on my SAS Portal page which calls a Stored Process. That STP creates 1-n files in a loop and puts them in an archive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;	ODS PACKAGE(LISTZIP) open nopf;
	//for every id provided, create an xml file and add it to the package
		ODS PACKAGE(LISTZIP) add file="&amp;amp;filepath._&amp;amp;i." mimetype="text/xml" TEXT;&lt;BR /&gt;
	ODS PACKAGE(LISTZIP) publish archive properties (archive_name="&amp;amp;l_archiv." archive_path="&amp;amp;l_work.");
	ODS PACKAGE(LISTZIP) close;&lt;/PRE&gt;
&lt;P&gt;After file creation, I have tried either &lt;EM&gt;data set to _webout&lt;/EM&gt; or &lt;EM&gt;proc stream&lt;/EM&gt; to return the zip-file to the user&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%LET RV = %SYSFUNC(appsrv_header(Content-disposition,%STR(attachment; filename=&amp;amp;fname.)));&lt;BR /&gt;%LET RV = %SYSFUNC(appsrv_header(Content-Type,application/octet-stream));&lt;BR /&gt;&lt;BR /&gt;filename out "&amp;amp;outfile.";
proc stream outfile=_webout;
begin 
&amp;amp;streamdelim. readfile outfile;
;;;;
run;

/* or data step */

data _NULL_;
    file _WEBOUT;
    infile "&amp;amp;outfile.";
    input;
    put _INFILE_;
run;&lt;/PRE&gt;
&lt;P&gt;I download the archive on a windows client and open it, but it only shows one out of three files and if I try to open that file I get a CRC-error, file corrupted. Weirdly enough, this only happens if the files inside the archive are larger than a certain size.&lt;/P&gt;
&lt;P&gt;Further can I access the produced archive on the Unix filesystem, transfer it to my machine wie ftp client and open it and its contents without any problems at all.&lt;/P&gt;
&lt;P&gt;When hex-comparing the downloaded version with the ftp´d one, I can see there are a few '0A's in the downloaded version that are not in the ftp´d one and a few '0D's in the ftp´d version that are not in the downloaded one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having all these hints leads me to believe I have some issue regarding linebreak-formatting in transfer (0D Carriage-Return, 0A Line-Feed (Unix), 0D0A (Windows)). But I am not sure how to adress this issue. The files are generated and archived on the Unix-Server, how do I stream the archive to a client in SAS Portal to be accessible? I´m working with SAS 9.4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Mat&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS: As a workaround I´m sending the archive via Mail and it works without a problem. Strengthens my focus on the issue beeing transfer to the client via browser.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13976i4A555A820158B866/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="correct_archive.png" title="correct_archive.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13977iB16A987AED95BB16/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="corrupted_archive.png" title="corrupted_archive.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13978i47954C1FC61ACDFC/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="errormsg.png" title="errormsg.png" /&gt;</description>
      <pubDate>Fri, 23 Jun 2017 14:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Cross-plattform-archive-transfer-SAS-Portal/m-p/369917#M18854</guid>
      <dc:creator>Maze</dc:creator>
      <dc:date>2017-06-23T14:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cross-plattform archive transfer / SAS Portal</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Cross-plattform-archive-transfer-SAS-Portal/m-p/418543#M19950</link>
      <description>&lt;P&gt;Hello everyone. I have been faced almost with this issue about two years ago and I can't solve it yet.&lt;/P&gt;&lt;P&gt;As well as the TS, I can't use .zip archive (or any other archive) with appsrv_header function. Result file is corrupt and I can't open it.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Cross-plattform-archive-transfer-SAS-Portal/m-p/418543#M19950</guid>
      <dc:creator>Ujinn_Dave</dc:creator>
      <dc:date>2017-12-05T18:13:41Z</dc:date>
    </item>
  </channel>
</rss>

