<?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: Flag value getting cut off in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568560#M11684</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running this piece of code, but even though here it says LEAD, in the output it shows up as LEA. Why is the flag value getting cut off?&lt;/P&gt;
&lt;P&gt;This is the first instance of the variable flag that SAS encounters, so it's not even that the size of flag is being set before by some other value. Appreciate the help. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set abc;
if stage in ('45','35') then flag="LEAD";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you ran this code more than once then you &lt;STRONG&gt;do have&lt;/STRONG&gt; the variable flag in the data set ABC because you placed it there.&lt;/P&gt;
&lt;P&gt;This is a side effect of using the&lt;/P&gt;
&lt;P&gt;Data abc;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set abc;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code structure. The first time you ran that code and there were no errors preventing the execution you completely replaced the data set.&lt;/P&gt;
&lt;P&gt;If you previously ran the code with a logic error such as:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;if stage in ('45','35') then flag="LEA"; &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;then you created a text variable with a length of 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When testing recoding of variables always send the output to a different data set so you do not corrupt your starting data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also post your log with code and any messages together into a code box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something else: define "getting cut off". How are you seeing a "cut off" value? Did you Print the data set (or at least that variable)? Put statement in the data step? Something else?&lt;/P&gt;
&lt;P&gt;Have you run Proc contents on the data set to tell you what the properties of the variable Flag might be? Perhaps somehow it acquired a format of $3. limiting what value will display in either a viewtable or printed output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2019 21:09:10 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-06-24T21:09:10Z</dc:date>
    <item>
      <title>Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568447#M11670</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running this piece of code, but even though here it says LEAD, in the output it shows up as LEA. Why is the flag value getting cut off?&lt;/P&gt;&lt;P&gt;This is the first instance of the variable flag that SAS encounters, so it's not even that the size of flag is being set before by some other value. Appreciate the help. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set abc;
if stage in ('45','35') then flag="LEAD";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 18:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568447#M11670</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-06-24T18:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568450#M11672</link>
      <description>&lt;P&gt;It might be that flag already exists in dataset abc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;length flag $8;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;before&lt;/U&gt; the set statement.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 18:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568450#M11672</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-06-24T18:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568479#M11674</link>
      <description>For some reason that didn't help either. It still displays as LEA.&lt;BR /&gt;&lt;BR /&gt;This flag has not been declared, initialized or used anywhere else before this statement, that's what's confusing me</description>
      <pubDate>Mon, 24 Jun 2019 18:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568479#M11674</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-06-24T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568480#M11675</link>
      <description>This is what the log says at the end of that datastep:&lt;BR /&gt;&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;2765:4&lt;BR /&gt;NOTE: There were 522116 observations read from the data set WORK.ABC.&lt;BR /&gt;NOTE: The data set WORK.ABC has 522116 observations and 14 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.17 seconds&lt;BR /&gt;cpu time 0.18 seconds</description>
      <pubDate>Mon, 24 Jun 2019 18:43:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568480#M11675</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-06-24T18:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568485#M11676</link>
      <description>&lt;P&gt;Then try&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set abc(drop=flag);
if stage in (45, 35) then flag="LEAD";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 18:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568485#M11676</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-06-24T18:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568488#M11678</link>
      <description>&lt;P&gt;It is possible that the issues is with a format that is attached to the variable.&amp;nbsp; Changing the length will not change the format attached. So if you force the length to by 8 bytes but it still has $3 format attached to it then only the first three characters will show on printouts.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 18:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568488#M11678</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-24T18:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Flag value getting cut off</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568560#M11684</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265086"&gt;@AJ_Brien&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running this piece of code, but even though here it says LEAD, in the output it shows up as LEA. Why is the flag value getting cut off?&lt;/P&gt;
&lt;P&gt;This is the first instance of the variable flag that SAS encounters, so it's not even that the size of flag is being set before by some other value. Appreciate the help. Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set abc;
if stage in ('45','35') then flag="LEAD";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you ran this code more than once then you &lt;STRONG&gt;do have&lt;/STRONG&gt; the variable flag in the data set ABC because you placed it there.&lt;/P&gt;
&lt;P&gt;This is a side effect of using the&lt;/P&gt;
&lt;P&gt;Data abc;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set abc;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code structure. The first time you ran that code and there were no errors preventing the execution you completely replaced the data set.&lt;/P&gt;
&lt;P&gt;If you previously ran the code with a logic error such as:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;if stage in ('45','35') then flag="LEA"; &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;then you created a text variable with a length of 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When testing recoding of variables always send the output to a different data set so you do not corrupt your starting data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also post your log with code and any messages together into a code box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something else: define "getting cut off". How are you seeing a "cut off" value? Did you Print the data set (or at least that variable)? Put statement in the data step? Something else?&lt;/P&gt;
&lt;P&gt;Have you run Proc contents on the data set to tell you what the properties of the variable Flag might be? Perhaps somehow it acquired a format of $3. limiting what value will display in either a viewtable or printed output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 21:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flag-value-getting-cut-off/m-p/568560#M11684</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-24T21:09:10Z</dc:date>
    </item>
  </channel>
</rss>

