<?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: Format variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388941#M93263</link>
    <description>&lt;P&gt;You are obviously skipping something very important as there are no values for B shown. The empty data set created by the shown SQL does have a length of 6.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 19:21:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-08-17T19:21:34Z</dc:date>
    <item>
      <title>Format variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388877#M93250</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I create a table using a proc sql:&lt;/P&gt;&lt;PRE&gt;PROC SQL;
CREATE TABLE A
(B char(6) label = "BA");
QUIT;&lt;/PRE&gt;&lt;P&gt;For every rows, the column B is filled in with "PA".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally the column B of my table A has a length of 2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like it to remain to 6 as I ask it to do...because in a next step I merge with another table which has more than 2 characters and otherwise it creates truncation problems.&lt;/P&gt;&lt;P&gt;Do you &amp;nbsp;know how I could do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&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;</description>
      <pubDate>Thu, 17 Aug 2017 16:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388877#M93250</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-17T16:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Format variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388880#M93251</link>
      <description>&lt;P&gt;Add a&amp;nbsp;length statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE A
(B char(6) label = "BA" length=8);
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 16:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388880#M93251</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-17T16:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Format variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388891#M93254</link>
      <description>Hi Reeza, thanks for this.&lt;BR /&gt;&lt;BR /&gt;I tried it and the problem remains.&lt;BR /&gt;But why did you write 8? I want 6! ^^</description>
      <pubDate>Thu, 17 Aug 2017 17:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388891#M93254</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-08-17T17:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Format variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388895#M93255</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153928"&gt;@FP12&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But why did you write 8? I want 6! ^^&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then change it to 6.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153928"&gt;@FP12&lt;/a&gt; wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried it and the problem remains.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show what you tried and what the 'problem remains' means. Explain in detail, preferably using the example/code we can run. It works in the demonstration code I presented so either you're not stating something that's important or doing something else that's changing it somewhere else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output here clearly shows the length is now 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Output&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Contents: Variables" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="5" scope="colgroup"&gt;Alphabetic List of Variables and Attributes&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Label&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;B&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;TD class="l data"&gt;BA&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE A
(B char(6) label = "BA" length=8);
QUIT;

proc contents data=a;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Aug 2017 17:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388895#M93255</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-17T17:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Format variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388941#M93263</link>
      <description>&lt;P&gt;You are obviously skipping something very important as there are no values for B shown. The empty data set created by the shown SQL does have a length of 6.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 19:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-variable/m-p/388941#M93263</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-17T19:21:34Z</dc:date>
    </item>
  </channel>
</rss>

