<?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: please let me know the length of the variable City_Country? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850653#M37260</link>
    <description>&lt;P&gt;Maxim 4: If in Doubt, Do a Test Run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your code, and inspect the dataset, or run PROC CONTENTS and read the output.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 17:51:09 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-12-21T17:51:09Z</dc:date>
    <item>
      <title>please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850650#M37258</link>
      <description>&lt;P&gt;this is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.test;&lt;BR /&gt;First = 'Ipswich, England';&lt;BR /&gt;City_Country = substr(First,1,7)!!', '!!'England';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 17:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850650#M37258</guid>
      <dc:creator>AnkitaSingh_901</dc:creator>
      <dc:date>2022-12-21T17:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850652#M37259</link>
      <description>&lt;P&gt;You can run PROC CONTENTS on the data set and find out yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 17:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850652#M37259</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-21T17:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850653#M37260</link>
      <description>&lt;P&gt;Maxim 4: If in Doubt, Do a Test Run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your code, and inspect the dataset, or run PROC CONTENTS and read the output.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 17:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850653#M37260</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-21T17:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850654#M37261</link>
      <description>&lt;P&gt;Try the LENGTH function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
	First = 'Ipswich, England';
	City_Country = substr(First,1,7)!!', '!!'England';
	HowLong=length(City_Country);
	put "NOTE: City_Country is " HowLong "characters long.";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 17:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850654#M37261</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-12-21T17:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850660#M37262</link>
      <description>i did that.. its showing length is 25. But i am not able to understand how??&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2022 18:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850660#M37262</guid>
      <dc:creator>AnkitaSingh_901</dc:creator>
      <dc:date>2022-12-21T18:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: please let me know the length of the variable City_Country?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850663#M37263</link>
      <description>&lt;P&gt;That will show how long the value stored is CITY_COUNTRY is.&amp;nbsp; To see how long the variable is you need to use VLENGTH() function instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.test;
  First = 'Ipswich, England';
  City_Country = substr(First,1,7)!!', '!!'England';

  HowLong = vlength(First);
  put 'NOTE: First can hold ' howlong 'bytes.';
  HowLong = vlength(city_country);
  put 'NOTE: City_Country can hold ' howlong 'bytes.';

  HowLong=length(City_Country);
  put 'NOTE: "' City_Country $varying100. howlong '" is ' HowLong 'bytes long.';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The reason that CITY_COUNTRY is defined to be able to hold 25 bytes is that is the GUESS that SAS made about what the maximum length string could have been generated by assignment statement where it first appeared.&amp;nbsp; 16 bytes is the maximum length for FIRST and then you are appending 9 additional bytes. 16+9=25.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 19:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/please-let-me-know-the-length-of-the-variable-City-Country/m-p/850663#M37263</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-21T19:06:22Z</dc:date>
    </item>
  </channel>
</rss>

