<?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: FTP .csv file from Mainframe(SAS) to FTP location(Windows server) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116792#M32208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, NYSPhil. Option RS=NONE worked magic for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using XMITIP to send ODS CSV file created on mainframe as email. Without RS option, lines were breaking incorrectly when i open the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jun 2013 18:10:21 GMT</pubDate>
    <dc:creator>Newbie_SAS</dc:creator>
    <dc:date>2013-06-27T18:10:21Z</dc:date>
    <item>
      <title>FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116788#M32204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to FTP a mainframe dataset in .csv format to a ftp location.I used the extension as .csv in the mainframe sas code.The problem is when I open the file in the ftp server(file opens in excel) one record is spread over&lt;/P&gt;&lt;P&gt;multiple rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:I need the data to be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John California Los Angeles &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead the data is opening in excel like this&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;california&lt;/P&gt;&lt;P&gt;los angeles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to correct this by using the text-to-column option in excel,but it does not help.I think this something to do with the way I ftp data from mainframe to the ftp location.&lt;/P&gt;&lt;P&gt;Below is the code I ran to FTP the file:&lt;/P&gt;&lt;P&gt;%MACRO MCASPLT(MCA1,FNME1,F1);&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %LET TEXT_FLG=N;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %PUT "TEXT FLG B4 LOOP:" &amp;amp;TEXT_FLG;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET DATAOT1.NBARI;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF MCA = "&amp;amp;MCA1" THEN DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CALL SYMPUT('TEXT_FLG', 'Y');&lt;/P&gt;&lt;P&gt;&amp;nbsp; %PUT "TEXT FLG IN LOOP:" &amp;amp;TEXT_FLG;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; FILE &amp;amp;FNME1&amp;nbsp; DSD DLM=",";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PUT VCA&amp;nbsp; ADMDT DISDT ADMTYPE_NM ADMSRC_NM DISP_NM AGE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ED_IND PAT_ENC_CSN_ID MDC SCHED EXPIRED BASECLASS SEX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOS&amp;nbsp; BMI35 HSP_ACCOUNT_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ADT_PATIENT_STAT_C PAT_CLASS&amp;nbsp; INP_ADM_DT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; END;&lt;/P&gt;&lt;P&gt; RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%IF &amp;amp;TEXT_FLG&amp;nbsp; =&amp;nbsp; Y&amp;nbsp; %THEN %DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET OUT_LRECL=3000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET CD=fff\ggg\fdfdf\TEST;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET HLQO=AAAA.Y3012.XAAA.&amp;amp;F1..TXTOUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LET OUT_NAME=XAAA.&amp;amp;F1..CSV;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME NCHS01 "&amp;amp;HLQO" DISP=SHR;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILENAME NCHS FTP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "&amp;amp;OUT_NAME"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;HOST_PORT_USER_PASS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CD = "&amp;amp;CD"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LRECL = &amp;amp;OUT_LRECL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INFILE NCHS01 SHAREBUFFERS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FILE NCHS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT _INFILE_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %END;&lt;/P&gt;&lt;P&gt; %MEND;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please share your thoughts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 17:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116788#M32204</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-07-24T17:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116789#M32205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try the BINARY&amp;nbsp; ftp option when you use FILENAME FTP ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BINARY&lt;/P&gt;&lt;P&gt;is fixed-record format. Thus, all records are of size LRECL with no line delimiters.&lt;/P&gt;&lt;P&gt;Data is transferred in image (binary) mode.&lt;/P&gt;&lt;P&gt;The BINARY option overrides the value of RECFM= in the FILENAME FTP&lt;/P&gt;&lt;P&gt;statement, if specified, and forces a binary transfer.&lt;/P&gt;&lt;P&gt;Alias: RECFM=F&lt;/P&gt;&lt;P&gt;Interaction: If you specify the BINARY option and the S370V or S370VS option,&lt;/P&gt;&lt;P&gt;then SAS ignores the BINARY option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 02:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116789#M32205</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-25T02:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116790#M32206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that ODS CSV generates a hex '15' to separate records, and this hex character does not translate well when copying data from mainframe to servers.&amp;nbsp; I add RS=NONE to my ODS statement when generating a CSV file on the mainframe.&amp;nbsp; This forces SAS to write a separate line of data for each report line.&amp;nbsp; You can then transfer your CSV file down to the server as a plain text file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 17:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116790#M32206</guid>
      <dc:creator>NYSPhil</dc:creator>
      <dc:date>2012-08-16T17:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116791#M32207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a number of ways to deal with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Without changing your SAS code you can open the file from within Excel and then tell it what character to use as a delimiter.&lt;/P&gt;&lt;P&gt;If you use a different extension than .csv then Excel will normally NOT try to import it without first giving you the option to specify format and control how it treats the columns.&amp;nbsp; This is what I normally do as Excel has nasty habit of removing leading zeros from character values that look like number as other worse modifications to your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) I do not see ODS CSV in your sample code.&amp;nbsp; You seem to be writing the data using FILE statement with a comma delimiter.&amp;nbsp; Commas should translate normally using ASCII FTP mode mode.&amp;nbsp; Where is the '15' coming from?&amp;nbsp; Is it on every line? between every field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) If the issue really is that the commas are appearing as '15'x then could add a line in your data step that is pulling from the FTP server and writing to a local file to translate that character.&amp;nbsp; For example this will translate '15'x into comma.&lt;/P&gt;&lt;P&gt; _infile_ = translate(_infile_,',','15'x);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:08:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116791#M32207</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-08-16T18:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116792#M32208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, NYSPhil. Option RS=NONE worked magic for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using XMITIP to send ODS CSV file created on mainframe as email. Without RS option, lines were breaking incorrectly when i open the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jun 2013 18:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116792#M32208</guid>
      <dc:creator>Newbie_SAS</dc:creator>
      <dc:date>2013-06-27T18:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: FTP .csv file from Mainframe(SAS) to FTP location(Windows server)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116793#M32209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not write directly into the FTP file from the first datastep?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 08:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FTP-csv-file-from-Mainframe-SAS-to-FTP-location-Windows-server/m-p/116793#M32209</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-06-28T08:50:31Z</dc:date>
    </item>
  </channel>
</rss>

