<?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 Selectively/Conditionally put QUOTES around values of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selectively-Conditionally-put-QUOTES-around-values-of-a-variable/m-p/822338#M324725</link>
    <description>&lt;P&gt;Missed asking this question &lt;A href="https://proofpointisolation.com/browser?url=https%3A%2F%2Fcommunities.sas.com%2Ft5%2FSAS-Programming%2FSelectively-Quote-variables-when-output-them-to-csv%2Fm-p%2F822335%2Femcs_t%2FS2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufEw1Q1NYUjFQWEdISVZUfDgyMjMzNXxTVUJTQ1JJUFRJT05TfGhL%23M324722" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very similar question, but put quotes for Horsepower &amp;gt; 250 and NOT put quotes for Horsepower if it does not meet the condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;
    file "/path/output/unix/cars.csv"
    dsd dlm = ',';
    set sashelp.cars;
    if _n_ = 1 then put @1 
    "Make,Model,Type,Origin,DriveTrain,MSRP,Invoice,EngineSize,Cylinders,Horsepower,MPG_City,MPG_Highway,Weight,Wheelbase,Length"; 
    put Make
		Model
		Type
		Origin
		DriveTrain
		MSRP
		Invoice
		EngineSize
		Cylinders
		Horsepower ~
		MPG_City
		MPG_Highway
		Weight
		Wheelbase
		Length;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Jul 2022 18:56:34 GMT</pubDate>
    <dc:creator>david27</dc:creator>
    <dc:date>2022-07-08T18:56:34Z</dc:date>
    <item>
      <title>Selectively/Conditionally put QUOTES around values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selectively-Conditionally-put-QUOTES-around-values-of-a-variable/m-p/822338#M324725</link>
      <description>&lt;P&gt;Missed asking this question &lt;A href="https://proofpointisolation.com/browser?url=https%3A%2F%2Fcommunities.sas.com%2Ft5%2FSAS-Programming%2FSelectively-Quote-variables-when-output-them-to-csv%2Fm-p%2F822335%2Femcs_t%2FS2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufEw1Q1NYUjFQWEdISVZUfDgyMjMzNXxTVUJTQ1JJUFRJT05TfGhL%23M324722" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very similar question, but put quotes for Horsepower &amp;gt; 250 and NOT put quotes for Horsepower if it does not meet the condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;
    file "/path/output/unix/cars.csv"
    dsd dlm = ',';
    set sashelp.cars;
    if _n_ = 1 then put @1 
    "Make,Model,Type,Origin,DriveTrain,MSRP,Invoice,EngineSize,Cylinders,Horsepower,MPG_City,MPG_Highway,Weight,Wheelbase,Length"; 
    put Make
		Model
		Type
		Origin
		DriveTrain
		MSRP
		Invoice
		EngineSize
		Cylinders
		Horsepower ~
		MPG_City
		MPG_Highway
		Weight
		Wheelbase
		Length;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2022 18:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selectively-Conditionally-put-QUOTES-around-values-of-a-variable/m-p/822338#M324725</guid>
      <dc:creator>david27</dc:creator>
      <dc:date>2022-07-08T18:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selectively/Conditionally put QUOTES around values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selectively-Conditionally-put-QUOTES-around-values-of-a-variable/m-p/822341#M324727</link>
      <description>&lt;PRE&gt;458  data _null_;
459    set sashelp.cars(obs=5);
460    file log dsd ;
461  put
462    Make
463    Model
464    MSRP
465    EngineSize
466    Cylinders
467    @
468  ;
469  if horsepower &amp;gt; 250 then put Horsepower ~ @;
470  else put Horsepower @;
471  put
472    MPG_City
473  ;
474  run;

Acura,MDX,"$36,945",3.5,6,"265",17
Acura,RSX Type S 2dr,"$23,820",2,4,200,24
Acura,TSX 4dr,"$26,990",2.4,4,200,22
Acura,TL 4dr,"$33,195",3.2,6,"270",20
Acura,3.5 RL 4dr,"$43,755",3.5,6,225,18
NOTE: There were 5 observations read from the data set SASHELP.CARS.
&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jul 2022 19:04:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selectively-Conditionally-put-QUOTES-around-values-of-a-variable/m-p/822341#M324727</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-08T19:04:51Z</dc:date>
    </item>
  </channel>
</rss>

