<?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: Data step in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916847#M41030</link>
    <description>&lt;P&gt;Okay, makes sense. Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 18:56:28 GMT</pubDate>
    <dc:creator>moorem30</dc:creator>
    <dc:date>2024-02-19T18:56:28Z</dc:date>
    <item>
      <title>Data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916842#M41028</link>
      <description>&lt;P&gt;I am fairly new to SAS and have inherited someone else's code. I noticed the below state in the code is where you see a change in the character length of the provider name. Prior to this step the character length for provider name = 50, after this step the provider name = 14 characters. Is anyone able to tell me why this is happening? Does the character length need to be set since applying an if statement and name change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data HRC_4b;&lt;BR /&gt;set HRC_4;&lt;BR /&gt;format homecare_BEGIN_DATE datetime20.;&lt;BR /&gt;format homecare_BEGIN_DATE2 DISCHARGE_DATE2 date9.;&lt;/P&gt;&lt;P&gt;HOMECARE_BEGIN_DATE = SERVICE_BEGIN_DATE;&lt;BR /&gt;HOMECARE_BEGIN_DATE2 = datepart(SERVICE_BEGIN_DATE);&lt;BR /&gt;DISCHARGE_DATE2 = datepart(DISCHARGE_DATE);&lt;BR /&gt;HOMECARE_PROVIDER_ID = PROVIDER_ID;&lt;/P&gt;&lt;P&gt;if provider_id="1111111" then HOMECARE_PROVIDER_NAME="ABC of Tenango";&lt;BR /&gt;else if provider_id="222222" then HOMECARE_PROVIDER_NAME="ABC of Indiana County";&lt;BR /&gt;else HOMECARE_PROVIDER_NAME = PROVIDER_NAME;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916842#M41028</guid>
      <dc:creator>moorem30</dc:creator>
      <dc:date>2024-02-19T18:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916846#M41029</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463789"&gt;@moorem30&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am fairly new to SAS and have inherited someone else's code. I noticed the below state in the code is where you see a change in the character length of the provider name. Prior to this step the character length for provider name = 50, after this step the provider name = 14 characters.&lt;BR /&gt;set HRC_4;&lt;BR /&gt;format homecare_BEGIN_DATE datetime20.;&lt;BR /&gt;format homecare_BEGIN_DATE2 DISCHARGE_DATE2 date9.;&lt;/P&gt;
&lt;P&gt;HOMECARE_BEGIN_DATE = SERVICE_BEGIN_DATE;&lt;BR /&gt;HOMECARE_BEGIN_DATE2 = datepart(SERVICE_BEGIN_DATE);&lt;BR /&gt;DISCHARGE_DATE2 = datepart(DISCHARGE_DATE);&lt;BR /&gt;HOMECARE_PROVIDER_ID = PROVIDER_ID;&lt;/P&gt;
&lt;P&gt;if provider_id="1111111" then HOMECARE_PROVIDER_NAME="ABC of Tenango";&lt;BR /&gt;else if provider_id="222222" then HOMECARE_PROVIDER_NAME="ABC of Indiana County";&lt;BR /&gt;else HOMECARE_PROVIDER_NAME = PROVIDER_NAME;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I assume you mean ... please confirm this is what you mean ... that PROVIDER_NAME is length 50 while HOMECARE_PROVIDER_NAME is length 14.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, yes you need a length statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length homecare_provide_name $ 50;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;before HOMECARE_PROVIDER_NAME is used. Why? Because the first time HOMECARE_PROVIDER_NAME is used in the code, it is assigned a length long enough to fit whatever the text length is, it is assigned a length to be the length of&amp;nbsp;"ABC of Tenango", which is apparently 14. If you put the LENGTH statement before that, then HOMECARE_PROVIDER_NAME has length 50.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916846#M41029</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-19T18:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Data step</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916847#M41030</link>
      <description>&lt;P&gt;Okay, makes sense. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 18:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Data-step/m-p/916847#M41030</guid>
      <dc:creator>moorem30</dc:creator>
      <dc:date>2024-02-19T18:56:28Z</dc:date>
    </item>
  </channel>
</rss>

