<?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: How to create .csv sas dataset on mainframe with column headings? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118195#M32624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can just use a data step.&amp;nbsp; See this thread:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/116724#116724"&gt;https://communities.sas.com/message/116724#116724&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or on SAS-L&lt;/P&gt;&lt;P&gt;&lt;A href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1202C&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;F=P&amp;amp;P=11485&amp;amp;F="&gt;http://listserv.uga.edu/cgi-bin/wa?A2=ind1202C&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;F=P&amp;amp;P=11485&amp;amp;F=&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jul 2012 20:00:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-07-28T20:00:11Z</dc:date>
    <item>
      <title>How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118189#M32618</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 create a .csv sas dataset on mainframe with column headings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET DATAOT1.NRI;&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;&amp;nbsp; FILE &amp;amp;FNME1&amp;nbsp; DSD DLM=',' LRECL=8000 TITLES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; IF _N_ EQ 1 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PUT @1 'MCA,MN1,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,V_ALL_BARI,CANCER,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,INP_ADM_DT';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; PUT MCA MRN1 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 V_ALL_BARI CANCER 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;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;but this code is not writing the column headings.Also in the sas log I see the note that the quouted string(put @1) exceeded 256 characters.&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>Wed, 25 Jul 2012 21:22:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118189#M32618</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-07-25T21:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118190#M32619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to mention the above code is in a macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 21:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118190#M32619</guid>
      <dc:creator>renjithr</dc:creator>
      <dc:date>2012-07-25T21:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118191#M32620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the culprit might be the&lt;/P&gt;&lt;P&gt; IF MCA = "&amp;amp;MCA1" THEN DO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this condition is not true for the very first record you won't get your headings.&lt;/P&gt;&lt;P&gt;It looks like you are trying to only export the records where this value holds true. If that is so instead of the If statement use a where clause on the set statement to subset the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; SET DATAOT1.NRI (where =( MCA = "&amp;amp;MCA1" ));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and remove the IF THEN DO; and END; statements.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2012 22:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118191#M32620</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-07-25T22:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118192#M32621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using proc export ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc export data=sashelp.class(where=(sex='F')) dbms=csv outfile='c:\x.csv' replace;&lt;/P&gt;&lt;P&gt;putnames=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;/P&gt;&lt;P&gt;ods csv file='c:\x.csv' ;&lt;/P&gt;&lt;P&gt;proc print data=sashelp.class(where=(sex='F')) noobs;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods csv close;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2012 04:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118192#M32621</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-26T04:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118193#M32622</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;Can you use the &lt;SPAN style="font-family: 'courier new', courier;"&gt;%ds2csv&lt;/SPAN&gt; macro? It puts out the column headings by default:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lebaseutilref/63492/HTML/default/viewer.htm#n0yo3bszlrh0byn1j4fxh4ndei8u.htm" title="http://support.sas.com/documentation/cdl/en/lebaseutilref/63492/HTML/default/viewer.htm#n0yo3bszlrh0byn1j4fxh4ndei8u.htm"&gt;http://support.sas.com/documentation/cdl/en/lebaseutilref/63492/HTML/default/viewer.htm#n0yo3bszlrh0byn1j4fxh4ndei8u.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2012 11:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118193#M32622</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2012-07-26T11:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118194#M32623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I use when creating a CSV file on the mainframe is ODS CSVALL.&amp;nbsp; I use with a formatted output proc like PROC PRINT.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;ODS CSVALL FILE = CSVFILE RS=NONE;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=PRTDATA NOOBS LABEL SPLIT='*';&lt;/P&gt;&lt;P&gt;VAR DATA1 DATA2 ETC.&lt;/P&gt;&lt;P&gt;ODS CSVALL CLOSE;&lt;/P&gt;&lt;P&gt;Don't know how it would work with DATA _NULL_ output&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2012 19:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118194#M32623</guid>
      <dc:creator>NYSPhil</dc:creator>
      <dc:date>2012-07-27T19:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create .csv sas dataset on mainframe with column headings?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118195#M32624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can just use a data step.&amp;nbsp; See this thread:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/116724#116724"&gt;https://communities.sas.com/message/116724#116724&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Or on SAS-L&lt;/P&gt;&lt;P&gt;&lt;A href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1202C&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;F=P&amp;amp;P=11485&amp;amp;F="&gt;http://listserv.uga.edu/cgi-bin/wa?A2=ind1202C&amp;amp;L=sas-l&amp;amp;D=0&amp;amp;F=P&amp;amp;P=11485&amp;amp;F=&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jul 2012 20:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-create-csv-sas-dataset-on-mainframe-with-column-headings/m-p/118195#M32624</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-07-28T20:00:11Z</dc:date>
    </item>
  </channel>
</rss>

