<?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 handle and display Single quote in format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494112#M130151</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Just concatenate it, e.g:&lt;/P&gt;
&lt;PRE&gt;call execute(cat("'spqtcfs'='Supince QTcF - Fridericia","'","s correction fomula"));&lt;/PRE&gt;
&lt;P&gt;Is there a reason why you are using call execute here at all?&amp;nbsp; I don't see any reason for it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That doesn't look right.&amp;nbsp; With that the code that CALL EXECUTE() sends will now be missing the ending single quote for the second string.&amp;nbsp; Although SAS might let it execute since SAS does still sometimes allow you to omit quotes from around strings in VALUE statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Sep 2018 13:11:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-09-10T13:11:37Z</dc:date>
    <item>
      <title>How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494096#M130145</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
      call execute ("proc format;");
      call execute ("value $parm");
      call execute ("'SPQTCFS' = 'Supine QTcF - Fridericia's#Correction Formula (msec)'");
      call execute ("'SPHRMS' = 'Supine Summary (mean) Heart Rate#(beats/min)';") ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to define a format with single quote?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g. In following case -&lt;/P&gt;&lt;P&gt;call execute ("value $parm");&lt;BR /&gt;call execute ("'SPQTCFS' = 'Supine QTcF -&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Fridericia's&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Correction Formula (msec)'");&lt;BR /&gt;call execute ("'SPHRMS' = 'Supine Summary (mean) Heart Rate#(beats/min)';")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to create a format for the given test code. But due to single quote I am not able to do it. I have tried using quoting functions but couldn't helped.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other case, I replaced Single quote with * in order to create the format but at the end I am expecting my label values to be displayed with Quote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any solution on this! (SAS 9.4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it is not clear enough let me know will provide some more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;PankP&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 11:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494096#M130145</guid>
      <dc:creator>Pankp</dc:creator>
      <dc:date>2018-09-10T11:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494100#M130147</link>
      <description>&lt;P&gt;Just concatenate it, e.g:&lt;/P&gt;
&lt;PRE&gt;call execute(cat("'spqtcfs'='Supince QTcF - Fridericia","'","s correction fomula"));&lt;/PRE&gt;
&lt;P&gt;Is there a reason why you are using call execute here at all?&amp;nbsp; I don't see any reason for it?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 12:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494100#M130147</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-10T12:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494101#M130148</link>
      <description>&lt;P&gt;There's a minor omission in our program.&amp;nbsp; It probably is not the source of the problem, but you should add:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call execute('run;');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code looks fine.&amp;nbsp; If it's just plain not working, reverse the single and double quotes, and use two single quotes for the apostrophe:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;call &lt;SPAN class="token keyword"&gt;execute&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;('"&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;SPQTCFS" = "Supine QTcF - Fridericia''s#Correction Formula (msec)"'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Sep 2018 12:06:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494101#M130148</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-10T12:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494111#M130150</link>
      <description>&lt;P&gt;Make sure you are generating valid SAS code.&amp;nbsp; If the content of a quoted string contains the character used to quote it then you need to double that character.&amp;nbsp; Or else you need to change to using the other type of quote on the outside.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your program is generating this line of code to pass to SAS via CALL EXECUTE()&lt;/P&gt;
&lt;PRE&gt;'SPQTCFS' = 'Supine QTcF - Fridericia's#Correction Formula (msec)'&lt;/PRE&gt;
&lt;P&gt;It should be generating either&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'SPQTCFS' = 'Supine QTcF - Fridericia''s#Correction Formula (msec)'&lt;/PRE&gt;
&lt;P&gt;or&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;'SPQTCFS' = "Supine QTcF - Fridericia's#Correction Formula (msec)"&lt;/PRE&gt;
&lt;P&gt;So change your code to this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call execute ("'SPQTCFS' = 'Supine QTcF - Fridericia''s#Correction Formula (msec)'");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 13:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494111#M130150</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-09-10T13:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494112#M130151</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Just concatenate it, e.g:&lt;/P&gt;
&lt;PRE&gt;call execute(cat("'spqtcfs'='Supince QTcF - Fridericia","'","s correction fomula"));&lt;/PRE&gt;
&lt;P&gt;Is there a reason why you are using call execute here at all?&amp;nbsp; I don't see any reason for it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That doesn't look right.&amp;nbsp; With that the code that CALL EXECUTE() sends will now be missing the ending single quote for the second string.&amp;nbsp; Although SAS might let it execute since SAS does still sometimes allow you to omit quotes from around strings in VALUE statements.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 13:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494112#M130151</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-09-10T13:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494118#M130155</link>
      <description>&lt;P&gt;Your probably right Tom, to be honest I didn't look to far into the actual code, just wanted to present concatenating the various parts.&amp;nbsp; It seems very odd to me that a proc format is being generated in this way, considering if this comes from a file, you could read it into a datastep and then cntlin that rather than faffing about with generating the code, and if its an include, then just include the proc format.&amp;nbsp; It all just seems a bit pointless.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 13:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494118#M130155</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-10T13:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494149#M130172</link>
      <description>&lt;P&gt;PROC FORMAT supports creating a format from a data set using CNTLIN. You need to create a data set in a specific format but it's usually simpler.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data my_fmt;
infile cards dlm="," dsd;
fmtname="parm";
type="C";
length label $50.;
input start $  label $;
cards;
SPQTCFS, "Supine QTcF - Fridericia's#Correction Formula (msec)"
SPHRMS,  "Supine Summary (mean) Heart Rate#(beats/min)"
;;;;
 run;

 proc format cntlin=my_fmt;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Sep 2018 14:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/494149#M130172</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T14:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle and display Single quote in format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/602784#M174560</link>
      <description>This was bit misleading and incorrect. I should have simply done using proc format instead of call execute. Sorry for delayed in response but the issue got resolved last year itself. Thanks for your valuable response.</description>
      <pubDate>Fri, 08 Nov 2019 17:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-handle-and-display-Single-quote-in-format/m-p/602784#M174560</guid>
      <dc:creator>Pankp</dc:creator>
      <dc:date>2019-11-08T17:23:08Z</dc:date>
    </item>
  </channel>
</rss>

