<?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: Keeping an unscheduled visit from one dataset in a Hash Object merge in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840831#M332458</link>
    <description>&lt;P&gt;No problem. Let's take a step back.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have 2 datasets have1 and have2. You want all the obs from have2 and only some obs from have1. This is not a lookup thing. This can be done by simply doing&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input  SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. ;
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|20|Day 1      |
1004|EASITOTA|22JUL2022|99|Unscheduled|
1004|EASITOTA|03AUG2022|30|Week 2     |
1004|EASITOTA|17AUG2022|40|Week 4     |
1004|EASITOTA|14SEP2022|50|Week 8     |
;
run;

data have2;
input  SUBJID $  ADT :$9. AVISITN :8. AVISIT :$12. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|21JUL2022|20|Day 1	 |0|0|0|0|0|0|0|1
1004|03AUG2022|30|Week 2 |0|0|0|0|0|0|0|1
1004|17AUG2022|40|Week 4 |0|0|0|0|0|0|0|1
1004|14SEP2022|50|Week 8 |0|0|0|0|0|0|0|1
;
run;

data want;
   set have2
       have1(where = (AVISIT = 'Unscheduled'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now comes the issue of looking up values. Seems to me that the&amp;nbsp;PARAMCD is the only variable you may want to look up? Or do you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2022 11:56:54 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-10-26T11:56:54Z</dc:date>
    <item>
      <title>Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840790#M332440</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to keep an unscheduled visit that is only in one dataset for an aval derivation but I'm using a hash object merge. Here is a snippet of my data and dersired output.&lt;/P&gt;
&lt;PRE&gt;data have1;
input  SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. AVAL :8. ;
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|2|Day 1        |16.3&lt;BR /&gt;1004|EASITOTA|22JUL2022|99|Unscheduled |18
1004|EASITOTA|03AUG2022|4|Week 2   |8.6
1004|EASITOTA|17AUG2022|5|Week 4   |8.7
1004|EASITOTA|14SEP2022|6|Week 8   |9.6
;
run;

data have2;
input  SUBJID $  ADT :$9. AVISITN :8. AVISIT :$12. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|21JUL2022|20|Day 1	|0|0|0|0|0|0|0|1
1004|03AUG2022|40|Week 2|0|0|0|0|0|0|0|1
1004|17AUG2022|50|Week 4|0|0|0|0|0|0|0|1
1004|14SEP2022|60|Week 8|0|0|0|0|0|0|0|1
1004|13OCT2022|70|Week 12|0|0|0|0|0|0|0|1
1004|10NOV2022|80|Week 16|0|0|0|0|0|0|0|1
;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&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;LI-CODE lang="sas"&gt;data want;
input SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. AVAL :8. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|20|Day 1	|16.3|0|0|0|0|0|0|0|1
1004|EASITOTA|22JUL2022|99|Unscheduled	|18  | | | | | | | | 
1004|EASITOTA|03AUG2022|40|Week 2	|8.6 |0|0|0|0|0|0|0|1
1004|EASITOTA|17AUG2022|50|Week 4	|8.7 |0|0|0|0|0|0|0|1
1004|EASITOTA|14SEP2022|60|Week 8	|9.6 |0|0|0|0|0|0|0|1
1004|EASITOTA|         |70|Week 12      |    |0|0|0|0|0|0|0|1
1004|EASITOTA|         |80|Week 16      |    |0|0|0|0|0|0|0|1
;
run;&lt;/LI-CODE&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840790#M332440</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T12:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840792#M332441</link>
      <description>&lt;P&gt;Turn the lookup logic around. Read have1 in the Set Statement and look up from have2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input  SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12.;
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|20|Day 1      |
1004|EASITOTA|22JUL2022|99|Unscheduled|
1004|EASITOTA|03AUG2022|30|Week 2     |
1004|EASITOTA|17AUG2022|40|Week 4     |
1004|EASITOTA|14SEP2022|50|Week 8     |
;
run;

data have2;
input  SUBJID $  ADT :$9. AVISITN :8. AVISIT :$12. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|21JUL2022|20|Day 1	 |0|0|0|0|0|0|0|1
1004|03AUG2022|30|Week 2 |0|0|0|0|0|0|0|1
1004|17AUG2022|40|Week 4 |0|0|0|0|0|0|0|1
1004|14SEP2022|50|Week 8 |0|0|0|0|0|0|0|1
;
run;

data want(drop=rc);
length subjid $40 avisit $200;
   if _N_ = 1 then do;
      dcl hash h(dataset : 'have2');
      h.definekey('SUBJID','AVISITN');
      h.definedata(all : 'Y');
      h.definedone();
   end;

   set have1;      
   if 0 then set have2; 

   call missing(of RTT1L28D -- NCUNODEV);

   rc = h.find();

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2022 10:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840792#M332441</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T10:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840794#M332443</link>
      <description>&lt;P&gt;That works on the snippet dataset but not the actual dataset although the actual dataset have more column variables. Is it the case of increasing the call missing to account for them?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 10:41:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840794#M332443</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T10:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840796#M332444</link>
      <description>&lt;P&gt;It probably is. But I can't see your actual data, so I don't know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 10:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840796#M332444</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T10:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840827#M332455</link>
      <description>&lt;P&gt;Yes I can't reverse the lookup logic. I need to keep it as is but somehow keep that Unscheduled visit too. Maybe hash object might be more trouble than it is worth here.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 11:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840827#M332455</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T11:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840828#M332456</link>
      <description>&lt;P&gt;Why can't you reverse the lookup logic?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 11:46:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840828#M332456</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T11:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840829#M332457</link>
      <description>&lt;P&gt;it cause issues with the spec requirements. I need to retain all the visits from have2 but also an unscheduled visit with a baseline value of 'Y' from have1 essentially. If I reverse the logic visits from have2 that are not present in have1 are omitted. Sorry I know that is additional details not covered in the datasets provided but thought the solution would of been quicker with a simpler structure as it's a complicated dataset and spec.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 11:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840829#M332457</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T11:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840831#M332458</link>
      <description>&lt;P&gt;No problem. Let's take a step back.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have 2 datasets have1 and have2. You want all the obs from have2 and only some obs from have1. This is not a lookup thing. This can be done by simply doing&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input  SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. ;
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|20|Day 1      |
1004|EASITOTA|22JUL2022|99|Unscheduled|
1004|EASITOTA|03AUG2022|30|Week 2     |
1004|EASITOTA|17AUG2022|40|Week 4     |
1004|EASITOTA|14SEP2022|50|Week 8     |
;
run;

data have2;
input  SUBJID $  ADT :$9. AVISITN :8. AVISIT :$12. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|21JUL2022|20|Day 1	 |0|0|0|0|0|0|0|1
1004|03AUG2022|30|Week 2 |0|0|0|0|0|0|0|1
1004|17AUG2022|40|Week 4 |0|0|0|0|0|0|0|1
1004|14SEP2022|50|Week 8 |0|0|0|0|0|0|0|1
;
run;

data want;
   set have2
       have1(where = (AVISIT = 'Unscheduled'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now comes the issue of looking up values. Seems to me that the&amp;nbsp;PARAMCD is the only variable you may want to look up? Or do you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 11:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840831#M332458</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T11:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840833#M332459</link>
      <description>&lt;P&gt;well there is additional variables such as aval but I have already set the dataset (have1) to contain just the rows with paramcd ='EASITOTA' from the larger previous&amp;nbsp; dataset&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840833#M332459</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T12:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840836#M332461</link>
      <description>&lt;P&gt;The AVAL variable does not contain any values in the posted sample data so I removed it. If&amp;nbsp;&lt;SPAN&gt;paramcd ='EASITOTA' anyways, there is not need to look it up.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840836#M332461</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T12:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840837#M332462</link>
      <description>&lt;P&gt;I've updated the datasets to try and more accurately reflect what is required&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:11:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840837#M332462</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T12:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840838#M332463</link>
      <description>&lt;P&gt;Thank you. Where does the number 18 come from in the want data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. AVAL :8. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|20|Day 1         |16.3|0|0|0|0|0|0|0|1 
1004|EASITOTA|22JUL2022|99|Unscheduled   |18  | | | | | | | |  
1004|EASITOTA|03AUG2022|40|Week 2        |8.6 |0|0|0|0|0|0|0|1 
1004|EASITOTA|17AUG2022|50|Week 4        |8.7 |0|0|0|0|0|0|0|1 
1004|EASITOTA|14SEP2022|60|Week 8        |9.6 |0|0|0|0|0|0|0|1 
1004|EASITOTA|         |70|Week 12       |    |0|0|0|0|0|0|0|1 
1004|EASITOTA|         |80|Week 16       |    |0|0|0|0|0|0|0|1 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:15:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840838#M332463</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T12:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840839#M332464</link>
      <description>&lt;P&gt;yeah sorry I updated the unscheduled aval in have1 to be 18 also&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840839#M332464</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T12:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840844#M332467</link>
      <description>&lt;P&gt;Better? Now all you have to do is sort the data as you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input  SUBJID $ PARAMCD $ ADT :$9. AVISITN :8. AVISIT :$12. AVAL :8. ;
infile datalines dlm = '|';
datalines;
1004|EASITOTA|21JUL2022|2|Day 1        |16.3 
1004|EASITOTA|22JUL2022|99|Unscheduled |18   
1004|EASITOTA|03AUG2022|4|Week 2       |8.6  
1004|EASITOTA|17AUG2022|5|Week 4       |8.7  
1004|EASITOTA|14SEP2022|6|Week 8       |9.6  
;


data have2;
input  SUBJID $  ADT :$9. AVISITN :8. AVISIT :$12. RTT1L28D :8. RTT1G28D :8. SWREL :8.  SWNREL :8. T2CM :8. RTT1L14D :8. RTT1G14D :8. NCUNODEV :8.; 
infile datalines dlm = '|';
datalines;
1004|21JUL2022|20|Day 1  |0|0|0|0|0|0|0|1 
1004|03AUG2022|40|Week 2 |0|0|0|0|0|0|0|1 
1004|17AUG2022|50|Week 4 |0|0|0|0|0|0|0|1 
1004|14SEP2022|60|Week 8 |0|0|0|0|0|0|0|1 
1004|13OCT2022|70|Week 12|0|0|0|0|0|0|0|1 
1004|10NOV2022|80|Week 16|0|0|0|0|0|0|0|1 
;

data want;

   if _N_ = 1 then do;
      dcl hash h(dataset : 'have1');
      h.definekey('SUBJID','ADT');
      h.definedata('PARAMCD', 'AVAL');
      h.definedone();

   end;

   set have2
       have1(where = (AVISIT = 'Unscheduled'));

   call missing(PARAMCD, AVAL);

   if h.find() then call missing(ADT);

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840844#M332467</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T12:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840858#M332471</link>
      <description>&lt;P&gt;Perfect thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 12:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840858#M332471</guid>
      <dc:creator>smackerz1988</dc:creator>
      <dc:date>2022-10-26T12:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping an unscheduled visit from one dataset in a Hash Object merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840869#M332477</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2022 13:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-an-unscheduled-visit-from-one-dataset-in-a-Hash-Object/m-p/840869#M332477</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-26T13:19:16Z</dc:date>
    </item>
  </channel>
</rss>

