<?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 Add quote to only character word from given string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826782#M326573</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;partition_Path=/vcs_valuation_type=FRTB/vcs_run_subtype=ES/vcs_run_qualifier=FC/cob_year=2022/cob_month=03/cobdate=20220304/package_type=FLASH/resu&lt;BR /&gt;lt_type=FRTB_TRADERBOOK_PNL/result_request_id=5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;formatted_partition=&amp;nbsp;vcs_valuation_type="FRTB",vcs_run_subtype="ES",vcs_run_qualifier="FC",cob_year=2022,cob_month=03,cobdate=20220304,package_type&lt;/P&gt;
&lt;DIV class="sasSource"&gt;="FLASH",result_type="FRTB_TRADERBOOK_PNL",result_request_id=5;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have written one simple program to get formatted_partition based on above requirement but with my program it also adding doble quote to digits value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let filePath=/vcs_valuation_type=FRTB/vcs_run_subtype=ES/vcs_run_qualifier=FC/cob_year=2022/cob_month=03/cobdate=20220304/package_type=FLASH/resu&lt;BR /&gt;lt_type=FRTB_TRADERBOOK_PNL/result_request_id=5;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;temp=substr(tranwrd((tranwrd("&amp;amp;filePath",'/','",')),'=','="'),3);&lt;BR /&gt;form_path=compress(%sysfunc(cat(temp||'"')));&lt;BR /&gt;put form_path;&lt;BR /&gt;%let formPath=form_path;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone assist?&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2022 05:00:18 GMT</pubDate>
    <dc:creator>Tushar</dc:creator>
    <dc:date>2022-08-03T05:00:18Z</dc:date>
    <item>
      <title>Add quote to only character word from given string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826782#M326573</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;partition_Path=/vcs_valuation_type=FRTB/vcs_run_subtype=ES/vcs_run_qualifier=FC/cob_year=2022/cob_month=03/cobdate=20220304/package_type=FLASH/resu&lt;BR /&gt;lt_type=FRTB_TRADERBOOK_PNL/result_request_id=5;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;formatted_partition=&amp;nbsp;vcs_valuation_type="FRTB",vcs_run_subtype="ES",vcs_run_qualifier="FC",cob_year=2022,cob_month=03,cobdate=20220304,package_type&lt;/P&gt;
&lt;DIV class="sasSource"&gt;="FLASH",result_type="FRTB_TRADERBOOK_PNL",result_request_id=5;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have written one simple program to get formatted_partition based on above requirement but with my program it also adding doble quote to digits value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let filePath=/vcs_valuation_type=FRTB/vcs_run_subtype=ES/vcs_run_qualifier=FC/cob_year=2022/cob_month=03/cobdate=20220304/package_type=FLASH/resu&lt;BR /&gt;lt_type=FRTB_TRADERBOOK_PNL/result_request_id=5;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;temp=substr(tranwrd((tranwrd("&amp;amp;filePath",'/','",')),'=','="'),3);&lt;BR /&gt;form_path=compress(%sysfunc(cat(temp||'"')));&lt;BR /&gt;put form_path;&lt;BR /&gt;%let formPath=form_path;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone assist?&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 05:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826782#M326573</guid>
      <dc:creator>Tushar</dc:creator>
      <dc:date>2022-08-03T05:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Add quote to only character word from given string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826792#M326578</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   length have want $ 500 pair $ 100 value $ 40;
   have = symget('partition_path');
   
   if first(have) = '/' then pp = substr(have, 2);
   
   do i = 1 to countw(have, '/');
      pair = scan(have, i, '/');
      value = scan(pair, 2, '=');
      
      want = catx(',', want, scan(pair, 1, '='));
      
      if anyalpha(value) then do;
         want = catx('=', want, quote(trim(value)));
      end;
      else do;
         want = catx('=', want, value);
      end;
   end;
   
   call symputx('formatted_path', want);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2022 06:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826792#M326578</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-08-03T06:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add quote to only character word from given string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826794#M326580</link>
      <description>Thanks a lot, Work exactly i wanted.</description>
      <pubDate>Wed, 03 Aug 2022 06:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826794#M326580</guid>
      <dc:creator>Tushar</dc:creator>
      <dc:date>2022-08-03T06:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Add quote to only character word from given string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826842#M326597</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let filePath=/vcs_valuation_type=FRTB/vcs_run_subtype=ES/vcs_run_qualifier=FC/cob_year=2022/cob_month=03/cobdate=20220304/package_type=FLASH/result_type=FRTB_TRADERBOOK_PNL/result_request_id=5;

data x;
have=symget('filePath');
want=prxchange('s/\//,/i',-1,have);
want=prxchange('s/^,+//i',-1,want);

want=prxchange('s/(?&amp;lt;==)([a-z_]+)/"\1"/i',-1,want);

put have= / want=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Aug 2022 12:47:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826842#M326597</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-03T12:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add quote to only character word from given string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826848#M326601</link>
      <description>Thanks a lot &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;. This worked perfectly as well. Never thought of prxchange power. Going forward will use the same.</description>
      <pubDate>Wed, 03 Aug 2022 12:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-quote-to-only-character-word-from-given-string/m-p/826848#M326601</guid>
      <dc:creator>Tushar</dc:creator>
      <dc:date>2022-08-03T12:58:57Z</dc:date>
    </item>
  </channel>
</rss>

