<?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: question on choosing suitable proc for conditions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647770#M78659</link>
    <description>&lt;P&gt;Note that the view itself does not have an observation count, the observations are determined on demand when the view is actually executed.&lt;/P&gt;
&lt;P&gt;If you open the view like a dataset and see only column headers, then your WHERE condition has selected no observations. Maxim 3: Know Your Data. Inspect your dataset for the actual contents of the variables used in the WHERE. Take care of upper/lowercase specifically.&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 12:28:48 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-05-14T12:28:48Z</dc:date>
    <item>
      <title>question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647657#M78650</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I wanted to create UI using proc pmenu and associate it with a suitable proc, based on my conditions. For example i want to select only one hotel and a specific year from a specific country from my dataset and see output on the list of observations satisfies my condition. I tried proc sql but its not working. Any suggestions please which proc would be suitable to show only these conditions in the result window?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 00:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647657#M78650</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T00:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647658#M78651</link>
      <description>&lt;P&gt;Data&lt;/P&gt;
&lt;P&gt;Conditions&lt;/P&gt;
&lt;P&gt;Without know the sort of conditions and variable types involved not much can be suggested.&lt;/P&gt;
&lt;P&gt;And if Pmenu works you may consider the Window / macro %window for entering things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you got a manually written Proc SQL or data step that works? If not then it is not time to worry about Pmenu or Window controls yet.&lt;/P&gt;
&lt;P&gt;If using Enterprise Guide then Prompts might be in the process as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Not working" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the &amp;lt;&amp;gt; to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 00:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647658#M78651</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-14T00:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647707#M78653</link>
      <description>&lt;P&gt;To build something like this today, you create the report/query/whatever in Enterprise Guide, create user prompts that get the required condition values, use them in the code (values from prompts are supplied to the code as macro variables), and then convert the code to a stored process.&lt;/P&gt;
&lt;P&gt;Working with Menus created by PROC PMENU requires a Base SAS on the user's desktop, or a remote Base SAS with a graphical UI (usually, Base SAS running on UNIX with X Windows).&lt;/P&gt;
&lt;P&gt;Stored processes require only a browser on the user's side.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 06:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647707#M78653</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T06:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647758#M78655</link>
      <description>&lt;P&gt;Actually I wanted to view only the user given information from the dataset. I have tried the following code but i am not sure whether am i right here. This is the code i tried. I will explain my criteria here, from my dataset hotel.Hotel_bookings i wanted to filter only people who went to Resort hotel in 2015 from the country GBR. Also i have a variable reservation_status, from this i wanted to filter only people who check-out from this hotel which will show they are the confirmed bookings. I am new to sas so i am not very sure how to give this conditions. Please help&lt;/P&gt;&lt;PRE&gt;options nodate pageno=1 linesize=80 pagesize=60;
proc sql;
create view hotel.main2 as
select hotel,arrival_date_year,country
where (hotel='Resort hotel'contains arrival_date_year=2015)
from hotel.Hotel_bookings
having country='GBR';
title'People from GBR to resort hotel in 2015';
quit;

#Log report#

 options nodate pageno=1 linesize=80 pagesize=60;
21   proc sql;
22   create view hotel.main2 as
23   select hotel,arrival_date_year,country
24   where (hotel='Resort hotel'contains arrival_date_year=2015)
     -----        --------------
     22           49
     76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **,
              +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, BETWEEN, CONTAINS, EQ,
              EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=,
              |, ||, ~=.

NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release.  Inserting white space between a quoted string and the succeeding identifier is recommended.

ERROR 76-322: Syntax error, statement will be ignored.

25   from hotel.main1
26   having country='GBR';
27   title'People from GBR to resort hotel in 2015';
28   quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647758#M78655</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T11:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647764#M78656</link>
      <description>&lt;P&gt;Structured code is easier to read; also keep global statements outside of steps, for better readability.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let country=GBR;
%let hotel=Resort hotel;
%let year=2015;

title "People from &amp;amp;country. to &amp;amp;hotel. in &amp;amp;year.";

proc sql;
create view hotel.main2 as
  select
    hotel,
    arrival_date_year,
    country
  from hotel.Hotel_bookings
  where
    hotel = "&amp;amp;hotel." and
    arrival_date_year = &amp;amp;year. and
    country = "&amp;amp;country."
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once that works, you can populate the macro variables from user prompts.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 12:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647764#M78656</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T12:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647765#M78657</link>
      <description>Hi,&lt;BR /&gt;Since i am a student I have been installed sas 9.4 by my university on my laptop. I am just wondering how to filter the conditions mentioned in my post on any proc.. could you suggest me how to proceed please...&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 14 May 2020 12:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647765#M78657</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T12:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647767#M78658</link>
      <description>&lt;PRE&gt;NOTE: SQL view HOTEL.MAIN2 has been defined.
   quit;&lt;/PRE&gt;&lt;P&gt;After i run the code i got this message in log. And i can see main2 created in my explorer inside hotel library. But when i opened the main2 it says Data set has 0 observations showing in a dialog box. Only the column names are created inside main2.&lt;/P&gt;&lt;P&gt;Is this the correct output?&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 12:16:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647767#M78658</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T12:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647770#M78659</link>
      <description>&lt;P&gt;Note that the view itself does not have an observation count, the observations are determined on demand when the view is actually executed.&lt;/P&gt;
&lt;P&gt;If you open the view like a dataset and see only column headers, then your WHERE condition has selected no observations. Maxim 3: Know Your Data. Inspect your dataset for the actual contents of the variables used in the WHERE. Take care of upper/lowercase specifically.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 12:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647770#M78659</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T12:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647835#M78661</link>
      <description>&lt;P&gt;I dont know why there is no observations inside the main2, i have checked my dataset the variables i have declared in where statement is the same how it looks in the dataset.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amali6_2-1589467695764.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39444i6A223C967C31316A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amali6_2-1589467695764.png" alt="Amali6_2-1589467695764.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Amali6_3-1589467749298.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39445i07F868EB295C40D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Amali6_3-1589467749298.png" alt="Amali6_3-1589467749298.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The variables are included in the image. Where to correct to write the observations in main2, if you could help please...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 14:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647835#M78661</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T14:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647836#M78662</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;Take care of upper/lowercase specifically&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Correct spelling in conditions is of the utmost importance.&lt;/P&gt;
&lt;P&gt;"Resort hotel" is not equal to "Resort Hotel" !!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is another reason why we insist on proper posting of example data. A data step with datalines leaves no doubts about variable attributes, type, formats, and &lt;U&gt;contents&lt;/U&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 14:57:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647836#M78662</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-14T14:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: question on choosing suitable proc for conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647844#M78663</link>
      <description>&lt;P&gt;Thank you very much now i got all observations under main2. SO now can i create the UI using proc pmenu and connect the the UI and&amp;nbsp; sql file using the name menu2.&amp;nbsp; Whether am i right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help i really appreciate&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 15:15:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/question-on-choosing-suitable-proc-for-conditions/m-p/647844#M78663</guid>
      <dc:creator>Amali6</dc:creator>
      <dc:date>2020-05-14T15:15:55Z</dc:date>
    </item>
  </channel>
</rss>

