<?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: Comparison between different dataset to see variable is blank in all the dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878442#M38993</link>
    <description>&lt;P&gt;Title is a column in the dataset. Can you explain more about variable name in if statement as I am not very good with SAS. Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 31 May 2023 14:33:05 GMT</pubDate>
    <dc:creator>Sandeep77</dc:creator>
    <dc:date>2023-05-31T14:33:05Z</dc:date>
    <item>
      <title>Comparison between different dataset to see variable is blank in all the dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878430#M38990</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-offset-key="3qaq2-0-0"&gt;I&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-1-0"&gt; am&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-2-0"&gt; comparing&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-3-0"&gt; App&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-4-0"&gt;_&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-5-0"&gt;address&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-6-0"&gt;,&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-7-0"&gt; Sup&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-8-0"&gt;_&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-9-0"&gt;address&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-10-0"&gt;,&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-11-0"&gt; Original&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-12-0"&gt;_&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-13-0"&gt;address&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-14-0"&gt; and&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-15-0"&gt; Current&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-16-0"&gt;_&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-17-0"&gt;address&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-18-0"&gt;.&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-19-0"&gt; I&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-20-0"&gt; want&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-21-0"&gt; to&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-22-0"&gt; find&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-23-0"&gt; if&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-24-0"&gt; the&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-25-0"&gt; title&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-26-0"&gt; in&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-27-0"&gt; all&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-28-0"&gt; the&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-29-0"&gt; four&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-30-0"&gt; dataset&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-31-0"&gt; is&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-32-0"&gt; blank&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-33-0"&gt; then&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-34-0"&gt; 0&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-35-0"&gt; and&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-36-0"&gt; if&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-37-0"&gt; any&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-38-0"&gt; one&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-39-0"&gt; of&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-40-0"&gt; the&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-41-0"&gt; dataset&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-42-0"&gt; have&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-43-0"&gt; a&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-44-0"&gt; title&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-45-0"&gt; then&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-46-0"&gt; flag&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-47-0"&gt; it&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-48-0"&gt; as&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-49-0"&gt; 1&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-50-0"&gt;.&lt;/SPAN&gt;&lt;SPAN data-offset-key="3qaq2-51-0"&gt;&amp;nbsp;I am trying the below code but it is showing error. Can you please suggest?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Title_comparison;
set App_address Sup_address Original_address Current_address; 

if App_address: title ne "" or Sup_address: title ne "" or Original_address: title ne "" or Current_address: title ne "" then do; 
flag = 1;
end;
else flag = 0;  
run;
Error log:
29         data Title_comparison;
30         set App_address Sup_address Original_address Current_address;
31         
32         if App_address: title ne "" or Sup_address: title ne "" or Original_address: title ne "" or Current_address: title ne ""
                         _
                         22
                         76
32       ! then do;
ERROR 22-322: Syntax error, expecting one of the following: &amp;lt;, &amp;lt;=, =, &amp;gt;, &amp;gt;=, EQ, GE, GT, IN, LE, LT, NE, NG, NL, NOTIN, ^=, ~=.  

ERROR 76-322: Syntax error, statement will be ignored.

33         flag = 1;
34         end;
           ___
           161
ERROR 161-185: No matching DO/SELECT statement.

35         else flag = 0;
36         run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TITLE_COMPARISON may be incomplete.  When this step was stopped there were 0 observations and 32 
         variables.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 May 2023 14:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878430#M38990</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2023-05-31T14:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison between different dataset to see variable is blank in all the dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878441#M38992</link>
      <description>&lt;P&gt;What is the "title"?&lt;BR /&gt;You need Variable names in your if statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 14:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878441#M38992</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-05-31T14:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison between different dataset to see variable is blank in all the dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878442#M38993</link>
      <description>&lt;P&gt;Title is a column in the dataset. Can you explain more about variable name in if statement as I am not very good with SAS. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 14:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878442#M38993</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2023-05-31T14:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison between different dataset to see variable is blank in all the dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878452#M38994</link>
      <description>&lt;P&gt;Is this a ChatGpt or similar generated code?&lt;/P&gt;
&lt;P&gt;The : list builder with variable names only works in a place where a list is acceptable such as an array definition, keep/drop list , format assignment or function like SUM or MEAN that will accept a list of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So every use of : in this statement is illegal syntax and I am not sure what you thought it was attempting to do.&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;if App_address: title ne "" or Sup_address: title ne "" or Original_address: title ne "" or Current_address: title ne "" then do; 
flag = 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Are you trying to check if every variable in the data set App_address is doing something? &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You really don't access anything related to a dataset name in the body of a data step. You can add a variable using the IN= option to indicate if an observation has a contribution from a dataset but once the variables on are in the data vector the actual data set name is moot.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 14:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878452#M38994</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-31T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison between different dataset to see variable is blank in all the dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878453#M38995</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you sure you need a SET statement?&lt;BR /&gt;You are vertically appending 4 datasets &lt;BR /&gt;(work.App_address , work.Sup_address , work.Original_address and work.Current_address).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If title is a variable name in all 4, you simply need :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if strip(title) NE '' then ... ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But maybe you want to merge these datasets (horizontally) based on a key-variable (or multiple key-variables)?&lt;/P&gt;
&lt;P&gt;And maybe you want to flag the observations that have the same key-combination and missing titles in all 4 datasets&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 31 May 2023 14:55:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Comparison-between-different-dataset-to-see-variable-is-blank-in/m-p/878453#M38995</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-05-31T14:55:34Z</dc:date>
    </item>
  </channel>
</rss>

