<?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: enclose with double quotation mark in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893581#M353026</link>
    <description>&lt;P&gt;What are you doing?&amp;nbsp; Looks like you are reading in a file that has data in fixed columns.&amp;nbsp; Data that was generated on an IBM mainframe so you need to use special informats to read the values.&amp;nbsp; Once you have read the text variable using the $EBCDIC informat the values should be ASCII now.&amp;nbsp; So unless you plan to send the file to an IBM mainframe then you do not want to use the $EBCIDIC format to display the data since that will convert back into EBCIDC (which will look like gibberish if interpreted as ASCII character codes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How does the CSV file get into the picture?&amp;nbsp; I think you should solve your data input issue first before working on your output issues.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Sep 2023 15:28:05 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-11T15:28:05Z</dc:date>
    <item>
      <title>enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893093#M352790</link>
      <description>&lt;P&gt;if I want to enclose content of a field with double quotation mark, how to do&lt;/P&gt;
&lt;P&gt;e.g. hello becomes "hello"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also if I want add .000000 to content of a field, how do I do it?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 07:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893093#M352790</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-07T07:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893095#M352792</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length field $10;
field = "hello";
field = quote(field);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For your second question: if this is about a numeric variable, use a format which displays the desired decimals:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;number = 10;
format number 20.6;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Sep 2023 07:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893095#M352792</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-07T07:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893103#M352799</link>
      <description>&lt;PRE&gt;data outout;
length field $10;
field = "hello";
field = quote(field);
run;

proc print data=outout;
run;
&lt;/PRE&gt;
&lt;P&gt;I get "hello and not "hello"&lt;/P&gt;
&lt;P&gt;why?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 08:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893103#M352799</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-07T08:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893109#M352804</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the field variable has a length of 10, any text less than that length is padded by spaces. So try using the &lt;FONT face="courier new,courier"&gt;strip()&lt;/FONT&gt; function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outout;
  length field $10;
  field = "hello";
  field = quote(strip(field));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 09:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893109#M352804</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-09-07T09:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893128#M352819</link>
      <description>&lt;P&gt;QUOTE() does not automatically strip leading and trailing blanks; use the STRIP()function, as already suggested.&lt;/P&gt;
&lt;P&gt;I have gotten so used to more modern functions and routines (CATS, CATX, CALL SYMPUTX) that I tend to forget the "hidden blanks" (Maxim 46).&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 10:41:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893128#M352819</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-07T10:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893244#M352858</link>
      <description>Sorry it didnt work that field become ””””””&lt;BR /&gt;Let me clarify &lt;BR /&gt;What happened was i try to convert sas dataset to csv&lt;BR /&gt;This particular column was something like ^@000^@^@&lt;BR /&gt;After converted to csv, it became&lt;BR /&gt;22,33, hello,^@000&lt;BR /&gt;^@^@,44,55&lt;BR /&gt;So it has a lot of space in it and split into two lines in csv&lt;BR /&gt;I was told it is due to a cache return and so should put it inside “”&lt;BR /&gt;&lt;BR /&gt;  But i tried concatx and quote both give me “””””””</description>
      <pubDate>Fri, 08 Sep 2023 02:58:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893244#M352858</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-08T02:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893245#M352859</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22588"&gt;@Amir&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As the field variable has a length of 10, any text less than that length is padded by spaces. So try using the &lt;FONT face="courier new,courier"&gt;strip()&lt;/FONT&gt; function:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outout;
  length field $10;
  field = "hello";
  field = quote(strip(field));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Don't use STRIP() as that will remove the LEADING spaces and therefore change the MEANING of the value.&lt;/P&gt;
&lt;P&gt;Use TRIM() as it will remove just the TRAILING spaces.&amp;nbsp; SAS comparisons will ignore trailing spaces so removing them will not change the meaning.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 03:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893245#M352859</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-08T03:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893246#M352860</link>
      <description>&lt;P&gt;How did you create the CSV file?&amp;nbsp; SAS knows how to write delimited files and does not add extra spaces between the fields (or any space at all if the value is missing).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if your file has 5 variables.&amp;nbsp; Let's say they are named VAR1, VAR2 ... up to VAR5.&amp;nbsp; Then to generate a CSV file from it just do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv 'somefilename.csv';
data _null_;
  set have;
  file csv dsd ;
  put var1-var5 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Make sure the logical record length (the LRECL= option of the FILE statement) is long enough for the longest values to avoid it inserting a line break when the values will not fit on the line.&amp;nbsp; The default LRECL is now 32,767 bytes.&amp;nbsp; But you can use values much larger if you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also make sure none of the values contain the end of line characters you are using.&amp;nbsp; On Unix the default end of line is just a LineFeed character ('0A'x) and on Windows it is the two byte sequence of a Carriage Return character ('0D'x) and Line Feed character.&amp;nbsp; Otherwise your generate file will be impossible to parse.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the DSD option on the FILE statement SAS will default the delimiter to a comma (you can change it with the DLM= option). And it will add quotes around any value that contains the delimiter to insure that the generated lines can be parsed without confusion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If for some strange reason you want to force SAS to add quotes around a particular variable you can use the ~ modifier on the PUT statement.&amp;nbsp; So for example if you wanted quotes to be added around the value of VAR3 whether or not the value is something that needs to be quoted you could change the PUT statement to :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put var1 var2 var3 ~ var4 var5 ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Let's try to convert your comment into actual data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile cards dsd truncover;
  input var1 var2 var3 :$10. var4 :$30. var5 var6 ;
cards;
22,33,hello,^@000^@^@,44,55
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now we can generate a normal CSV file like this:&lt;/P&gt;
&lt;PRE&gt;375  data _null_;
376    file log dsd;
377    set have;
378    put var1-var6;
379  run;

22,33,hello,^@000^@^@,44,55
&lt;/PRE&gt;
&lt;P&gt;Or we can add ~ modifier for the character variables so it generates a file that has extra quotes added that do nothing to make the file more readable.&lt;/P&gt;
&lt;PRE&gt;399  data _null_;
400    file log dsd;
401    set have;
402    put var1 var2 var3 ~ var4 ~ var5 var6;
403  run;

22,33,"hello","^@000^@^@",44,55
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 13:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893246#M352860</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-08T13:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893257#M352868</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;True in the case of leading spaces. I suppose I couldn't convince you it was a typo!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;please pay heed to the good practice that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;has highlighted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 06:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893257#M352868</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-09-08T06:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893325#M352900</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/416388"&gt;@HeatherNewton&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;if I want to enclose content of a field with double quotation mark, how to do&lt;/P&gt;
&lt;P&gt;e.g. hello becomes "hello"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also if I want add .000000 to content of a field, how do I do it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Warning: &lt;STRONG&gt;Any&lt;/STRONG&gt; insertion of characters to a variable may fail because of length issues. If your variable is defined as 8 characters and has a current value like ABCDEFG (7 characters total) then adding quotes would attempt to be "ABCDEFG" for a total of &lt;STRONG&gt;9&lt;/STRONG&gt; characters. Since the variable in the example is defined as 8 then anything over 8 would be discarded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that .000000 to be added to a character or a numeric variable? If character, see the above note. Adding 7 characters is more likely to cause truncation issues than adding 2. If numeric change the format to one that forces enough decimal positions, such as 16.7 . But without knowing the range of values can't tell you the base format to use. Be aware that if you export such an read it with any spreadsheet software those trailing 0 are very likely to disappear for a column treated as numeric.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 15:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893325#M352900</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-08T15:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893543#M353019</link>
      <description>&lt;P&gt;I reread the program and realised these data is put in like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input&lt;/P&gt;
&lt;P&gt;int_amt S370fpd5.2&lt;/P&gt;
&lt;P&gt;int_rate $EBCDIC4.0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could&amp;nbsp;S370fpd5.2 or&amp;nbsp;S370fpd5.2 make numbers display in a strange way like symbol?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 10:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893543#M353019</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-11T10:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893547#M353020</link>
      <description>&lt;P&gt;this second column in $EBCDIC4.0 is giving me trouble, in sas it looks empty and after converting to csv it looks like &amp;amp; (1 digit) or 0 (but when use len(), says 2)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is the best way to convert this in csv and have it as utf8?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 11:24:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893547#M353020</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-11T11:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893548#M353021</link>
      <description>&lt;P&gt;What we see here are the&amp;nbsp;&lt;EM&gt;informats&lt;/EM&gt; used to read the data from an external file. How the data is&amp;nbsp;&lt;EM&gt;displayed&lt;/EM&gt; is controlled by the&amp;nbsp;&lt;EM&gt;formats&lt;/EM&gt;, so we need to see those.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 11:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893548#M353021</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-11T11:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893581#M353026</link>
      <description>&lt;P&gt;What are you doing?&amp;nbsp; Looks like you are reading in a file that has data in fixed columns.&amp;nbsp; Data that was generated on an IBM mainframe so you need to use special informats to read the values.&amp;nbsp; Once you have read the text variable using the $EBCDIC informat the values should be ASCII now.&amp;nbsp; So unless you plan to send the file to an IBM mainframe then you do not want to use the $EBCIDIC format to display the data since that will convert back into EBCIDC (which will look like gibberish if interpreted as ASCII character codes).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How does the CSV file get into the picture?&amp;nbsp; I think you should solve your data input issue first before working on your output issues.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 15:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893581#M353026</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-11T15:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893687#M353047</link>
      <description>I want to convert into csv then load into db2&lt;BR /&gt;What to do now</description>
      <pubDate>Tue, 12 Sep 2023 01:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893687#M353047</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-12T01:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893688#M353048</link>
      <description>It is then output as $4.0&lt;BR /&gt;So pretty normal?</description>
      <pubDate>Tue, 12 Sep 2023 02:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893688#M353048</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-12T02:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893689#M353049</link>
      <description>If output as $4.0 why i am getting symbols like ^@000^@^@  but splitted into two lines with cache return after convert to csv as original sas is showing 0 (but length is 2)&lt;BR /&gt;&lt;BR /&gt;I convert this way&lt;BR /&gt;&lt;BR /&gt;Filename exprt “/path/to/test.csv” encoding=“utf8”;&lt;BR /&gt;Proc export data=out.test outfile=exprt dbms=csv replace; run;</description>
      <pubDate>Tue, 12 Sep 2023 03:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893689#M353049</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-12T03:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893692#M353050</link>
      <description>&lt;P&gt;Please be more systematic is what you are testing and how you reporting your results here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What did you do to create the SAS dataset?&amp;nbsp; Did you read in a text file, like you implied with the snippet of an INPUT statement?&amp;nbsp; Did you run that code on an IBM mainframe or on an ASCII based machine?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does the SAS dataset you now have look like?&amp;nbsp; How many variables are their? How many observations?&amp;nbsp; Can you just print the data?&amp;nbsp; Does it look right?&amp;nbsp; If not then perhaps there is something wrong with the step that created the dataset from the text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you try to create the CSV file?&amp;nbsp; Did you write your own data step?&amp;nbsp; Did you let PROC EXPORT write the data step for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are confused about what the text files look like then take advantage of the LIST statement in a data step to display what is in the text file.&amp;nbsp; &amp;nbsp;So run something like this on both the orignal text file and on the CSV File you created.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   infile textfile obs=5;
   input;
   list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How are you trying to load the CSV into DB2?&amp;nbsp; Why didn't you just tell DB2 to read the original text file? Can DB2 not do that?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 04:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893692#M353050</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-12T04:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893699#M353052</link>
      <description>&lt;PRE&gt;so this is the sequence
read from text file

data SDATA2.HKPBIM_STATIC;
infile "&amp;amp;G-IRF_RAW_PENDING_PATH./hkpb.static.txt" RECFM=N'
readdata:
input hkpbim_int_rate $EBCDIC4.0
.
.
.
FORMAT hkpbim_int_rate $4.0

THEN SDATA2.HKPBIM_STATIC is used to create wdata.installment using data step and nothing is done to the variable  hkpbim_int_rate  and wdata.installment is the file I want to convert to csv using the following code:
filename exprt "/toutput/path/installment.csv" encoding="utf-8";
proc export data=output.installment outfile=exprt dbms=csv replace; run;


&lt;/PRE&gt;
&lt;P&gt;now in the output most lines can be loaded into db2 using load insert command but as shown in picture attached where red line added, this row suddenly cannot be loaded because the input splitted into two lines unlike lines before and after it. I was told it was seperated by a 'cache return', not too sure but it sound likes it from a senior..&lt;/P&gt;
&lt;P&gt;and senior asked me to put "" in the field to resolve. I tried but I end up getting """"""""""""" as the input instead very weird. so my question is how to have this column load into db2 properly, right now it gets rejected? I will show you how sas display these in a bit.... I must convert into csv first..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IMG_9382.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87793iFB0F6AE2E79694C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="IMG_9382.jpg" alt="IMG_9382.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 05:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893699#M353052</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-12T05:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: enclose with double quotation mark</title>
      <link>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893706#M353056</link>
      <description>&lt;P&gt;oh in sas it is actually blank&lt;/P&gt;
&lt;P&gt;see attached next to 1077.27 (row 9243, col hkpbim_int_rate)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IMG_9384.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87794iA1FBDBA9B1E9DB44/image-size/large?v=v2&amp;amp;px=999" role="button" title="IMG_9384.jpg" alt="IMG_9384.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 06:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/enclose-with-double-quotation-mark/m-p/893706#M353056</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-09-12T06:41:40Z</dc:date>
    </item>
  </channel>
</rss>

