<?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 is this correct?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896184#M354093</link>
    <description>&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Use the code in the unfinished code section to create the data set call “two” from “one”, which you created in problem 1.&amp;nbsp; Add the following to “two”:&lt;/STRONG&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a new text variable called “yrob2” using the last 2 digits of the variable “yrob”.&amp;nbsp; For example if year = 1980 we would want 80 for this new variable.&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Next, create a new text variable called “last4” from SSN using the last 4 digits of the SSN.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Now, create a new text variable called “ID” by concatenating “clinic”, “mthob”, “yrob2” &amp;amp; “last4” (in this order).&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Remove any spaces or blanks from this new variable called “ID”.&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Remove all variables from this dataset except for name &amp;amp; ID. Hint: Think about the most efficient way to do this.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;finished Code&lt;/P&gt;&lt;P&gt;*Lab 8 – Problem 2;&lt;/P&gt;&lt;P&gt;title "Building an ID number from data";&lt;/P&gt;&lt;P&gt;data lab.ssn_number;&lt;BR /&gt;set lab.one;&lt;BR /&gt;ssn2 = compress(ssn, '-');&lt;BR /&gt;ssn3 = input(ssn2, ??11.);&lt;BR /&gt;drop ssn2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=lab.ssn_number;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2023 04:12:11 GMT</pubDate>
    <dc:creator>Markanti</dc:creator>
    <dc:date>2023-09-28T04:12:11Z</dc:date>
    <item>
      <title>is this correct??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896184#M354093</link>
      <description>&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Use the code in the unfinished code section to create the data set call “two” from “one”, which you created in problem 1.&amp;nbsp; Add the following to “two”:&lt;/STRONG&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a new text variable called “yrob2” using the last 2 digits of the variable “yrob”.&amp;nbsp; For example if year = 1980 we would want 80 for this new variable.&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Next, create a new text variable called “last4” from SSN using the last 4 digits of the SSN.&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Now, create a new text variable called “ID” by concatenating “clinic”, “mthob”, “yrob2” &amp;amp; “last4” (in this order).&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Remove any spaces or blanks from this new variable called “ID”.&amp;nbsp; &lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Remove all variables from this dataset except for name &amp;amp; ID. Hint: Think about the most efficient way to do this.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;finished Code&lt;/P&gt;&lt;P&gt;*Lab 8 – Problem 2;&lt;/P&gt;&lt;P&gt;title "Building an ID number from data";&lt;/P&gt;&lt;P&gt;data lab.ssn_number;&lt;BR /&gt;set lab.one;&lt;BR /&gt;ssn2 = compress(ssn, '-');&lt;BR /&gt;ssn3 = input(ssn2, ??11.);&lt;BR /&gt;drop ssn2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=lab.ssn_number;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 04:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896184#M354093</guid>
      <dc:creator>Markanti</dc:creator>
      <dc:date>2023-09-28T04:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: is this correct??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896187#M354094</link>
      <description>&lt;P&gt;The code you shared doesn't have much to do with solving problems 1 to 5.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To support homework forum members normally want to see some of your own effort and then help with the bits where you get really stuck after you first tried yourself.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 06:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896187#M354094</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-09-28T06:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: is this correct??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896274#M354142</link>
      <description>&lt;P&gt;Hint: When you have text values with a delimiter such as - that usually appears in SSN then SCAN is useful tool to get the nth element of the value&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint2: NEVER input parts of character values to numeric if the instruction is to Concatenate. You will lose leading zeroes and add complication to the code for concatenating.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I consider #3 to be dangerous in terms of actual use. Discuss this with your instructor.&lt;/P&gt;
&lt;P&gt;Suppose you have two values before removing blanks that look like this (because you created a numeric value from SSN of 0078 that becomes 78 for example)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;' 1 2 12 5678'&lt;BR /&gt;'12 12 56 78'&lt;/PRE&gt;
&lt;P&gt;If you remove blanks you get&lt;/P&gt;
&lt;PRE&gt;'12125678'
'12125678'&lt;/PRE&gt;
&lt;P&gt;Unless your codes for things like Clinic and your month always uses 2 digits (and years REALLY should use 4 digits, look up Y2K) you have a possibility of creating duplicate values that should mean different things. Of course I do not have any of your data to see how likely this is but is something to be aware of.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 15:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/is-this-correct/m-p/896274#M354142</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-09-28T15:27:30Z</dc:date>
    </item>
  </channel>
</rss>

