<?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: Stacking Data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697289#M213073</link>
    <description>&lt;P&gt;There is nothing syntactically wrong with your DATA step combining the three datasets. Please post the SAS log for that step so we can see what is going on.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Nov 2020 05:41:11 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-11-07T05:41:11Z</dc:date>
    <item>
      <title>Stacking Data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697288#M213072</link>
      <description>&lt;P&gt;I am having a hard time stacking my data sets. I have created three data sets but, when I go to stack them vertically, one of the data sets gets dropped and only two of my data sets get stacked. Here is what I have for code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.Contact_IA;&lt;/P&gt;&lt;P&gt;Set HypImpt.IowaResidents (rename= (ZipCd = ZipCdtoo&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;keep SSN Inits City StateCd ZipCd;&lt;/P&gt;&lt;P&gt;length inits $3.;&lt;BR /&gt;Inits = SUBSTR(Initials, 3, 2)||SUBSTR(Initials, 1, 1);&lt;/P&gt;&lt;P&gt;City = propcase(City);&lt;/P&gt;&lt;P&gt;StateCd = "IA";&lt;/P&gt;&lt;P&gt;ZipCd = PUT(ZipCdtoo, 5.);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LABEL SSN = "Social Security Number"&lt;BR /&gt;Inits = "Subject Initials"&lt;BR /&gt;City = "City"&lt;BR /&gt;StateCd = "State Code"&lt;BR /&gt;ZipCd = "Zip Code";&lt;/P&gt;&lt;P&gt;FORMAT StateCd $StateCd.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;PROC SORT;&lt;BR /&gt;BY SSN;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;proc contents data = work.contact_ia;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = work.contact_ia;&lt;BR /&gt;run;&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;&lt;P&gt;* Creating data for Mississippi *;&lt;BR /&gt;DATA WORK.Contact_MS;&lt;BR /&gt;set hypimpt.ms_citizens (rename = (SocSecNum = SSN))&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;inits = substr(Firstinit,1,1) || substr(middleinit, 1,1) ||substr(lastinit, 1,1);&lt;BR /&gt;StateCd= 'MS';&lt;BR /&gt;City = SCAN(CityState, 1, ',');&lt;BR /&gt;&lt;BR /&gt;keep ssn inits StateCd City Zipcd;&lt;BR /&gt;label SSN = 'Social Security Number'&lt;BR /&gt;Inits = "Subject Initials"&lt;BR /&gt;City = 'City'&lt;BR /&gt;StateCd= 'State Code'&lt;BR /&gt;ZipCd = 'Zip Code';&lt;BR /&gt;&lt;BR /&gt;format StateCd $StateCd.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Proc sort data = work.contact_MS;&lt;BR /&gt;by SSN;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc contents data = hypimpt.ms_citizens ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = hypimpt.ms_citizens;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Creating data for Utah *;&lt;BR /&gt;DATA WORK.Contact_UT;&lt;BR /&gt;retain SSN Inits City StateCd ZipCd;&lt;BR /&gt;set hypimpt.ut_records (rename = (inits= inits2&lt;BR /&gt;Zipcode= ZipCd));&lt;/P&gt;&lt;P&gt;SSNold = put(id, z9.);&lt;BR /&gt;&lt;BR /&gt;part1 = substr(SSNold, 1, 3);&lt;BR /&gt;part2 = substr(SSNold, 4, 2);&lt;BR /&gt;part3 = substr(SSNold, 6, 4);&lt;BR /&gt;length SSN $11.;&lt;BR /&gt;SSN = Catx('-', part1, part2, part3);&lt;/P&gt;&lt;P&gt;length inits $3.;&lt;BR /&gt;inits = tranwrd(compress(inits2, '.'), ' ', '-');&lt;/P&gt;&lt;P&gt;City = scan(Cityst, 1, ',');&lt;BR /&gt;StateCd = 'UT';&lt;/P&gt;&lt;P&gt;KEEP SSN Inits City StateCd ZipCd;&lt;/P&gt;&lt;P&gt;LABEL SSN = "Social Security Number"&lt;BR /&gt;Inits = "Subject Initials"&lt;BR /&gt;City = "City"&lt;BR /&gt;StateCd = "State Code"&lt;BR /&gt;ZipCd = "Zip Code";&lt;BR /&gt;FORMAT StateCd $StateCd.;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC SORT;&lt;BR /&gt;BY SSN;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;* Creating Combined Data Set *;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;DATA HypTabs.Contact;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;SET WORK.Contact_IA&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WORK.Contact_MS&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;WORK.Contact_UT;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 05:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697288#M213072</guid>
      <dc:creator>Krissy217</dc:creator>
      <dc:date>2020-11-07T05:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Stacking Data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697289#M213073</link>
      <description>&lt;P&gt;There is nothing syntactically wrong with your DATA step combining the three datasets. Please post the SAS log for that step so we can see what is going on.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 05:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697289#M213073</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-07T05:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Stacking Data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697290#M213074</link>
      <description>&lt;P&gt;Submit your code&amp;nbsp;&lt;EM&gt;step by step&lt;/EM&gt;, starting at the top. After each step, check the log, and only proceed to the next step once you have no ERRORs, WARNINGs, and no NOTEs beyond those that summarize the time taken, the observations read, and the observations and variables written. We call this a "clean log", see Maxim 25.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last problem in the log is always the&amp;nbsp;&lt;EM&gt;least important&lt;/EM&gt;, fixing the first problem from the top down usually cleans up most, if not all, of the others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever you have issues fixing a single step, post the &lt;EM&gt;complete&lt;/EM&gt; log from that step by copy/pasting it into a "code box" opened with the &amp;lt;/&amp;gt; button.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Nov 2020 06:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697290#M213074</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-07T06:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Stacking Data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697391#M213103</link>
      <description>&lt;P&gt;To much "work"&lt;/P&gt;
&lt;PRE&gt;SSNold = put(id, z9.);

part1 = substr(SSNold, 1, 3);
part2 = substr(SSNold, 4, 2);
part3 = substr(SSNold, 6, 4);
length SSN $11.;
SSN = Catx('-', part1, part2, part3);&lt;/PRE&gt;
&lt;P&gt;could be, if you really need a character SSN from numeric&lt;/P&gt;
&lt;PRE&gt;ssn = put(ssnold,ssn.);&lt;/PRE&gt;
&lt;P&gt;SAS supplies a format to display SSN with the dashes.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Nov 2020 03:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Stacking-Data-sets/m-p/697391#M213103</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-08T03:51:46Z</dc:date>
    </item>
  </channel>
</rss>

