<?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: Proc export if then in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/854019#M337547</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437191"&gt;@Coding4you&lt;/a&gt;&amp;nbsp; - Look at the macro code I posted.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jan 2023 19:10:50 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-01-16T19:10:50Z</dc:date>
    <item>
      <title>Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845276#M334160</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering is there a way to proc export a data if the data set name = this (as a pipe delimited txt file) else export as a CSV.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Sat, 19 Nov 2022 20:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845276#M334160</guid>
      <dc:creator>Coding4you</dc:creator>
      <dc:date>2022-11-19T20:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845277#M334161</link>
      <description>&lt;P&gt;An easy way is to set a default parameter on a macro then no conditional logic is required:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro MyExport (dataset =
                ,filename =  
                ,DLM = ','
               );
proc export data = &amp;amp;dataset
            file = "\MyFolder\&amp;amp;filename"&lt;BR /&gt;            DLM = &amp;amp;DLM
;
run;
%mend MyExport;
%MyExport (dataset = MyCSV, filename = \Myfolder\MyCSV.csv);
%MyExport (dataset = MyPipe, filename = \Myfolder\MyPipe.csv, DLM = '|');
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Nov 2022 21:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845277#M334161</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-11-19T21:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845323#M334184</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export
  data=&amp;amp;ds.
  dbms=dlm
  file="&amp;amp;outfile."
;
delimiter =
%if &amp;amp;ds. = A
%then %do;
","
%end;
%else %do;
"|"
%end;
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 20 Nov 2022 08:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845323#M334184</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-20T08:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845360#M334202</link>
      <description>Thank you</description>
      <pubDate>Sun, 20 Nov 2022 21:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845360#M334202</guid>
      <dc:creator>Coding4you</dc:creator>
      <dc:date>2022-11-20T21:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845361#M334203</link>
      <description>Thank you</description>
      <pubDate>Sun, 20 Nov 2022 21:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/845361#M334203</guid>
      <dc:creator>Coding4you</dc:creator>
      <dc:date>2022-11-20T21:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/853994#M337540</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I also ask is there a way to output the file in a txt file if its’s pipe delimited and csv if it’s in comma in that same piece of codes you provided below?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;&lt;P&gt;kelvin.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 15:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/853994#M337540</guid>
      <dc:creator>Coding4you</dc:creator>
      <dc:date>2023-01-16T15:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/853996#M337541</link>
      <description>&lt;P&gt;Clearly define&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the dataset names&lt;/LI&gt;
&lt;LI&gt;the filenames&lt;/LI&gt;
&lt;LI&gt;the delimiters&lt;/LI&gt;
&lt;LI&gt;and the rules for combining the&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 16 Jan 2023 15:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/853996#M337541</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-01-16T15:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export if then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/854019#M337547</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437191"&gt;@Coding4you&lt;/a&gt;&amp;nbsp; - Look at the macro code I posted.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2023 19:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-export-if-then/m-p/854019#M337547</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-01-16T19:10:50Z</dc:date>
    </item>
  </channel>
</rss>

