<?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 need help to modify the records in a variable. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290737#M59787</link>
    <description>&lt;P&gt;I have a dataset variable with a sql query in it, and i want to put the words in the parantheses into quotations to read that query from SAS.Not&amp;nbsp; sure how can i do that. Can any one please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example-&lt;/P&gt;&lt;P&gt;select t1.star, t2.movies,t1.origin&lt;/P&gt;&lt;P&gt;from (select movies, origin&amp;nbsp;from movie_list where origin=(USA)) t2&lt;/P&gt;&lt;P&gt;left outer join star_names t1&lt;/P&gt;&lt;P&gt;on t1.origin=t2.origin&lt;/P&gt;&lt;P&gt;(where t1.star_first_name=(leo) and t1.star_first_name=(brad))&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to put USA, leo and brad into single quotations like -('USA') ('leo') ('brad')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2016 15:12:34 GMT</pubDate>
    <dc:creator>npatel2302</dc:creator>
    <dc:date>2016-08-10T15:12:34Z</dc:date>
    <item>
      <title>need help to modify the records in a variable.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290737#M59787</link>
      <description>&lt;P&gt;I have a dataset variable with a sql query in it, and i want to put the words in the parantheses into quotations to read that query from SAS.Not&amp;nbsp; sure how can i do that. Can any one please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example-&lt;/P&gt;&lt;P&gt;select t1.star, t2.movies,t1.origin&lt;/P&gt;&lt;P&gt;from (select movies, origin&amp;nbsp;from movie_list where origin=(USA)) t2&lt;/P&gt;&lt;P&gt;left outer join star_names t1&lt;/P&gt;&lt;P&gt;on t1.origin=t2.origin&lt;/P&gt;&lt;P&gt;(where t1.star_first_name=(leo) and t1.star_first_name=(brad))&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to put USA, leo and brad into single quotations like -('USA') ('leo') ('brad')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290737#M59787</guid>
      <dc:creator>npatel2302</dc:creator>
      <dc:date>2016-08-10T15:12:34Z</dc:date>
    </item>
    <item>
      <title>Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290739#M59791</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset variable with a sql query in it, and i want to put the words in the parantheses into quotations to read that query from SAS.Not&amp;nbsp; sure how can i do that. Can any one please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example-&lt;/P&gt;&lt;P&gt;select t1.star, t2.movies,t1.origin&lt;/P&gt;&lt;P&gt;from (select movies, origin&amp;nbsp;from movie_list where origin=(USA)) t2&lt;/P&gt;&lt;P&gt;left outer join star_names t1&lt;/P&gt;&lt;P&gt;on t1.origin=t2.origin&lt;/P&gt;&lt;P&gt;(where t1.star_first_name=(leo) and t1.star_first_name=(brad))&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to put USA, leo and brad into single quotations like -('USA') ('leo') ('brad')&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290739#M59791</guid>
      <dc:creator>npatel2302</dc:creator>
      <dc:date>2016-08-10T15:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290743#M59792</link>
      <description>&lt;P&gt;The easiest way to get imbedded quotes is to use a different quote.&lt;/P&gt;
&lt;P&gt;You do not describe how you created the data set in the first place, which would probably be the best place to do this.&lt;/P&gt;
&lt;P&gt;Assuming you had something like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x='select t1.star, t2.movies,t1.origin
from (select movies, origin from movie_list where origin=(USA)) t2
left outer join star_names t1
on t1.origin=t2.origin
(where t1.star_first_name=(leo) and t1.star_first_name=(brad))
;
'  ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x='select t1.star, t2.movies,t1.origin
from (select movies, origin from movie_list where origin=("USA")) t2
left outer join star_names t1
on t1.origin=t2.origin
(where t1.star_first_name=("leo") and t1.star_first_name=("brad"))
;
'  ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the use of the " between the '&amp;nbsp;&amp;nbsp; ' that define the long string value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We may need more details on how you are building you dataset if you are not using simple assignments.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290743#M59792</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-10T15:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290746#M59794</link>
      <description>&lt;P&gt;The data is coming from one of the sql server table. Variable name is query_text which basically has the list of query associated with the claims processing. The output that you mentioned will not work as i will have run the whole query to SQL sever again using will be using macro for that, and double quotes might not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 15:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290746#M59794</guid>
      <dc:creator>npatel2302</dc:creator>
      <dc:date>2016-08-10T15:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290798#M59795</link>
      <description>&lt;P&gt;What do you want as a final result?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not seeing why you can't just type single quotes into your query at the moment...&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 19:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290798#M59795</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-10T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290799#M59796</link>
      <description>&lt;P&gt;This will also never evaluate to true:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(where t1.star_first_name=(leo) and t1.star_first_name=(brad))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Aug 2016 19:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290799#M59796</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-10T19:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to modify the records in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290819#M59798</link>
      <description>&lt;P&gt;Thanks for help Reeeza.&lt;/P&gt;&lt;P&gt;So in brief, i have a dataset with obs_number, query_text and application id, and that data is coming from one SQL server table.&lt;/P&gt;&lt;P&gt;Example of Query_text -&lt;/P&gt;&lt;P&gt;Select * from Table1 t1&lt;/P&gt;&lt;P&gt;left outer join Table2 t2&lt;/P&gt;&lt;P&gt;( t1.CASE_STATUS_TYPE_CD = (NEW) OR t1.CASE_STATUS_TYPE_CD = (OPEN) ) AND ( t3.SEARCH_VALUE_NAME = (HighVal_Ind) AND t3.SEARCH_VALUE_NUM &amp;lt;= 3 ) AND ( t4.SEARCH_VALUE_NAME = (Curr_Strategy) AND t4.SEARCH_VALUE_STRG = (095) ) GROUP BY t1.CASE_REFERENCE_NUM,t2.LAST_SCRFP_FRD_CARD,t1.SERVICE_XID ORDER BY t2.LAST_SCRFP_FRD_CARD DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i need to do in sas is to put quotations in to the character records as below&lt;/P&gt;&lt;P&gt;Select * from Table1 t1&lt;/P&gt;&lt;P&gt;left outer join Table2 t2&lt;/P&gt;&lt;P&gt;( t1.CASE_STATUS_TYPE_CD = (NEW) OR t1.CASE_STATUS_TYPE_CD = ('OPEN') ) AND ( t3.SEARCH_VALUE_NAME = ('HighVal_Ind') AND t3.SEARCH_VALUE_NUM &amp;lt;= 3 ) AND ( t4.SEARCH_VALUE_NAME = ('Curr_Strategy') AND t4.SEARCH_VALUE_STRG = ('095') ) GROUP BY t1.CASE_REFERENCE_NUM,t2.LAST_SCRFP_FRD_CARD,t1.SERVICE_XID ORDER BY t2.LAST_SCRFP_FRD_CARD DESC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that clarifies my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 20:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/need-help-to-modify-the-records-in-a-variable/m-p/290819#M59798</guid>
      <dc:creator>npatel2302</dc:creator>
      <dc:date>2016-08-10T20:30:28Z</dc:date>
    </item>
  </channel>
</rss>

