<?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: Help needed for SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985020#M43746</link>
    <description>&lt;P&gt;Make a new variable in the CHILD dataset that is one less than the child ID value and then merge on that.&amp;nbsp; Or do both in one step using PROC SQL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data parent;
  input parentid name :$20.;
cards;
1000 Smith
;

data child;
  input childid age ;
cards;
1001 10
;

proc sql;
create table want as select * 
from parent full join child
on parent.parentid = child.childid -1 
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Mar 2026 02:58:21 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2026-03-20T02:58:21Z</dc:date>
    <item>
      <title>Create a by variable to merge two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985019#M43745</link>
      <description>&lt;P&gt;Need help to create a by variable to merge two datasets.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One dataset is parent survey and one is a child. However they have no similar variable to link them but they are matched. I.e. participant ID for adults are even and children are odd.&lt;/P&gt;
&lt;P&gt;For example, parent 1000 matches with child 1001, parent 1002 matches with child 1003&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2026 07:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985019#M43745</guid>
      <dc:creator>Emilygreene0305</dc:creator>
      <dc:date>2026-03-20T07:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed for SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985020#M43746</link>
      <description>&lt;P&gt;Make a new variable in the CHILD dataset that is one less than the child ID value and then merge on that.&amp;nbsp; Or do both in one step using PROC SQL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data parent;
  input parentid name :$20.;
cards;
1000 Smith
;

data child;
  input childid age ;
cards;
1001 10
;

proc sql;
create table want as select * 
from parent full join child
on parent.parentid = child.childid -1 
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Mar 2026 02:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985020#M43746</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-03-20T02:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a by variable to merge two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985025#M43747</link>
      <description>Are they exactly one-to-one matched ? &lt;BR /&gt;One  parent might match multiple child ?&lt;BR /&gt;And could you post some data and desired output to explain your problem ?</description>
      <pubDate>Fri, 20 Mar 2026 11:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985025#M43747</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-03-20T11:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create a by variable to merge two datasets</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985112#M43750</link>
      <description>&lt;P&gt;So you always have only one child per parent person in your data?&lt;/P&gt;</description>
      <pubDate>Sun, 22 Mar 2026 13:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-by-variable-to-merge-two-datasets/m-p/985112#M43750</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-03-22T13:31:01Z</dc:date>
    </item>
  </channel>
</rss>

