<?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: including quotation mark for larger string in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342219#M22654</link>
    <description>&lt;PRE&gt;
data have;
    string = '"/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/abc def group report 20151010.html"'; output;
    string = '/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/report_20151010.html'; output;
run;

data want;
    set have;
    s = quote(dequote(string));
    keep s;
run;
proc print;run;

&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Mar 2017 04:11:13 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-03-18T04:11:13Z</dc:date>
    <item>
      <title>including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342017#M22634</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello Friends, i am referring existing big code and for one output - have two different values for one variable "file" - large string. one value has quotation mark and other doesn't as it doesn't has embedded space in between, i want to output larger string - which doesn't has qutation mark - WITH quotation mark as well - any suggestion please ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;have&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;"/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;20151001_bkp/abc def&amp;nbsp;group report 20151010.html"&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;20151001_bkp/report_20151010.html&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;want&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;"/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;20151001_bkp/abc def&amp;nbsp;group report 20151010.html"&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;&lt;FONT size="5" color="#339966"&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;&lt;/FONT&gt;/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT face="Calibri" size="3" color="#000000"&gt;20151001_bkp/report_20151010.html&lt;FONT size="5"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342017#M22634</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2017-03-17T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342030#M22635</link>
      <description>&lt;P&gt;Assuming I understand, I think the following will do what you want, which is to quote the string if not already quoted:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    string = '"/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/abc def group report 20151010.html"'; output;
    string = '/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/report_20151010.html'; output;
run;

data want;
    set have;
    string = prxchange('s/[^"]$|^[^"]/"/i', -1, strip(string));
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342030#M22635</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-17T15:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342049#M22637</link>
      <description>&lt;P&gt;Thank you Collinelliot,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;what I was thinking was reading from output file itself and then apply quotation mark to variable "files".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however, my challange to read below data is, since&amp;nbsp;have more variables along with "files" variable (like below) need to ask sas to read continuously - in some cases have " in end and in some case its not there -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have&lt;/P&gt;
&lt;P&gt;123456789 1234 -rwxr-x--- 1 xyzd "/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/P&gt;
&lt;P&gt;20151001_bkp/abc def group report 20151010.html"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;123456789 1234 -rwxr-x--- 1 xyzd&amp;nbsp; /abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/&lt;/P&gt;
&lt;P&gt;20151001_bkp/report_20151010.html&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so this is not working fine - may be becasue of have &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;more than one delimiter in raw file,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;xyz &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/wherever_my_file_is/test.txt"; &lt;FONT color="#339966"&gt;/*test.txt is what i said i have - above*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; id $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; size $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; permission $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; code $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; files $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;xyz &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; id size permission code&amp;nbsp;files @@;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 17:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342049#M22637</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2017-03-17T17:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342088#M22640</link>
      <description>&lt;P&gt;tried this way as well, but didn't work quite well...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it is reading fine variable where don't have space in between but not good for variable where have multiple space in between,,,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;xyz &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/wherever_my_file_is/test.txt"; &lt;FONT color="#339966"&gt;/*test.txt is what i said i have - above*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; id $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; size $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; permission $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; code $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;20&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; files $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;infile&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;xyz &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;" "&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; #1 id size permission code&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#2 files @@;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 18:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342088#M22640</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2017-03-17T18:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342179#M22646</link>
      <description>&lt;P&gt;Try attaching a text file with a couple example lines of data that behaves like your actual data (or some of your actual data if is ot sensitive).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect I am not the only one that is not sure what you are actually attempting read.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 22:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342179#M22646</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-17T22:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342219#M22654</link>
      <description>&lt;PRE&gt;
data have;
    string = '"/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/abc def group report 20151010.html"'; output;
    string = '/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/report_20151010.html'; output;
run;

data want;
    set have;
    s = quote(dequote(string));
    keep s;
run;
proc print;run;

&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Mar 2017 04:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342219#M22654</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-18T04:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342305#M22662</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26689"&gt;@woo&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Attaching representative sample data or a sub-set of real data would really help us to give you the right advise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the string with/without quotes is always at the very end of an input record like in the data you've posted then things could be quite simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the first 5 variables using a delimiter blank. This sets the input pointer after the last of the 5 variables (&lt;EM&gt;code&lt;/EM&gt;); then read the rest of the string not using any delimiter.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
  attrib
    id size permission xx code length=$10 informat=$10.
    PathFile length=$200
    ;
  infile datalines4 dlm=' ' truncover;
  input id size permission xx code PathFile $200.;
  PathFile=dequote(PathFile);
  datalines;
123456789 1234 -rwxr-x--- 1 xyzd "/abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/abc def group report 20151010.html"
123456789 1234 -rwxr-x--- 1 xyzd  /abcdef-u01/11111_SASGridGAML_HDprd/xxx/sas_jobs/yyy/data/history/487623847/20151001_bkp/report_20151010.html
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 01:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342305#M22662</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-03-19T01:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: including quotation mark for larger string</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342992#M22725</link>
      <description>Thanks a lot everyone - &lt;BR /&gt;my challenge was reading last long value which has double quotation mark for some values + and sometime no-quotation mark + space in between - however Patrick solution works absolutely fine,,,&lt;BR /&gt;&lt;BR /&gt;Again thanks a lot,,,&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Mar 2017 16:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/including-quotation-mark-for-larger-string/m-p/342992#M22725</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2017-03-21T16:40:02Z</dc:date>
    </item>
  </channel>
</rss>

