<?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 txt file from zip file on FTP in SAS 7.12 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533421#M146245</link>
    <description>&lt;P&gt;You meant &lt;EM&gt;copy&lt;/EM&gt;, not &lt;EM&gt;import&lt;/EM&gt;. I was confused.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;'s suggestion should work. Please post the full log if it doesn't.&lt;/P&gt;
&lt;P&gt;You'll have to use the ZIP engine to import the data once it's transferred.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename MYZIP zip "&amp;amp;zipfile" member="dir/file.txt" ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 22:07:47 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2019-02-06T22:07:47Z</dc:date>
    <item>
      <title>Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533402#M146231</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import a txt file in a zip folder from a FTP. It is delimited by&amp;nbsp;| . I am new to FTP and zip. I get an error that the directory or file doesn't exist.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename rmt ftp 'myfile.zip' host='website.com' 
user='user' pass='pass'
cd='directory' recfm=s debug;

FILENAME lcl 'folders/myfile.zip' recfm=n;

DATA _NULL_;
N=1;
INFILE rmt NBYTE=n;
INPUT;
FILE lcl ;
PUT _INFILE_ @@; 
RUn;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 21:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533402#M146231</guid>
      <dc:creator>hbh0810</dc:creator>
      <dc:date>2019-02-06T21:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533413#M146239</link>
      <description>&lt;P&gt;Are you using SAS UE? If so, the path should be /folders/myfolders/...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;filename rmt ftp 'myfile.zip' host='website.com' 
user='user' pass='pass'
cd='directory' recfm=s debug;

FILENAME lcl '&lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;/folders/myfolders/&lt;/STRONG&gt;&lt;/FONT&gt;myfile.zip' recfm=n;

DATA _NULL_;
N=1;
INFILE rmt NBYTE=n;
INPUT;
FILE lcl ;
PUT _INFILE_ @@; 
RUn;&lt;/PRE&gt;
&lt;P&gt;This just copies the files into your system. A nifty trick is to copy the file to your WORK folder, then when you end the session, the ZIP file is deleted as well. You would do that, as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename lcl "%sysfunc(getoption(work))/myfile.zip" recfm=n;&lt;/CODE&gt;&lt;/PRE&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/189734"&gt;@hbh0810&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to import a txt file in a zip folder from a FTP. It is delimited by&amp;nbsp;| . I am new to FTP and zip. I get an error that the directory or file doesn't exist.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename rmt ftp 'myfile.zip' host='website.com' 
user='user' pass='pass'
cd='directory' recfm=s debug;

FILENAME lcl 'folders/myfile.zip' recfm=n;

DATA _NULL_;
N=1;
INFILE rmt NBYTE=n;
INPUT;
FILE lcl ;
PUT _INFILE_ @@; 
RUn;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 21:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533413#M146239</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-06T21:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533421#M146245</link>
      <description>&lt;P&gt;You meant &lt;EM&gt;copy&lt;/EM&gt;, not &lt;EM&gt;import&lt;/EM&gt;. I was confused.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;'s suggestion should work. Please post the full log if it doesn't.&lt;/P&gt;
&lt;P&gt;You'll have to use the ZIP engine to import the data once it's transferred.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename MYZIP zip "&amp;amp;zipfile" member="dir/file.txt" ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 22:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533421#M146245</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-02-06T22:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533565#M146302</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the replies! I am using SAS EG. For the filename lcl should that the be the location I want to copy the zip file? For instance, the zip file is on the FTP site, but I want to copy it to my personal drive? For me it is a little more complicated b/c I can't copy to my C:/ I have to copy to something that looks more like&amp;nbsp;\\work.com\myfolder\ (I think b/c we have a server installation?). The log is below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;*';*";*/;quit;run;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPTIONS PAGENO=MIN;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET _CLIENTTASKLABEL='Program';&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET _CLIENTPROCESSFLOWNAME='Process Flow';&lt;/P&gt;&lt;P&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET _CLIENTPROJECTPATH='';&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET _CLIENTPROJECTNAME='';&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET _SASPROGRAMFILE=;&lt;/P&gt;&lt;P&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS _ALL_ CLOSE;&lt;/P&gt;&lt;P&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPTIONS DEV=ACTIVEX;&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GOPTIONS XPIXELS=0 YPIXELS=0;&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME EGSR TEMP;&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;/P&gt;&lt;P&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLE=HtmlBlue&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;/P&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NOGTITLE&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOGFOOTNOTE&lt;/P&gt;&lt;P&gt;18&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GPATH=&amp;amp;sasworklocation&lt;/P&gt;&lt;P&gt;19&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENCODING=UTF8&lt;/P&gt;&lt;P&gt;20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options(rolap="on")&lt;/P&gt;&lt;P&gt;21&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;/P&gt;&lt;P&gt;22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;23&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GOPTIONS ACCESSIBLE;&lt;/P&gt;&lt;P&gt;24&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;25&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA _NULL_;&lt;/P&gt;&lt;P&gt;26&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N=1;&lt;/P&gt;&lt;P&gt;27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE rmt NBYTE=n;&lt;/P&gt;&lt;P&gt;28&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT;&lt;/P&gt;&lt;P&gt;29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE lcl ;&lt;/P&gt;&lt;P&gt;30&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT _INFILE_ @@;&lt;/P&gt;&lt;P&gt;31&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: 220 Serv-U FTP Server v15.1 ready...&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 220 Serv-U FTP Server v15.1 ready...&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; USER ****&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 331 User name okay, need password.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PASS XXXXXXXXX&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 230 User logged in, proceed.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 ON&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 OPTS UTF8 is set to ON.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 NLST&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 'NLST': 'UTF8' options not understood.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF-8 NLST&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 'UTF-8 NLST': option not understood.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PORT 11,56,3,120,253,159&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PORT command successful.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; TYPE I&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 Type set to I.&lt;/P&gt;&lt;P&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; CWD Home/number/sector/price/area&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 550 / Home/number/sector/price/area: No such file or directory.&lt;/P&gt;&lt;P&gt;ERROR: Change Directory command for Home/number/sector/price/area failed.&lt;/P&gt;&lt;P&gt;ERROR: Directory or file Home/number/sector/price/area doesn't exist.&lt;/P&gt;&lt;P&gt;NOTE: UNBUFFERED is the default with RECFM=N.&lt;/P&gt;&lt;P&gt;NOTE: The file LCL is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=\\work.com\myfolder\price.zip,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=N,LRECL=256,File Size (bytes)=0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=07Feb2019:07:08:14,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for helping this newbie!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 12:27:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533565#M146302</guid>
      <dc:creator>hbh0810</dc:creator>
      <dc:date>2019-02-07T12:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533671#M146341</link>
      <description>&lt;P&gt;Not sure if it will help but do you the correct case for the directory in the change directory? i.e. is it Home or home? or any of the other directories?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 17:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533671#M146341</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-07T17:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import txt file from zip file on FTP in SAS 7.12</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533758#M146380</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; The log is below:&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. The log incomplete and does not include the filename statements&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. The log is quite clear: Your filename statement points to a directory called&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Home/number/sector/price/area&lt;/FONT&gt; which does not exist.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suspect you may have case issues and/or may be missing the initial slash or tilde.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 21:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-txt-file-from-zip-file-on-FTP-in-SAS-7-12/m-p/533758#M146380</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-02-07T21:34:19Z</dc:date>
    </item>
  </channel>
</rss>

