<?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 How to use a variable from data step as criteria in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204237#M50917</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi I have a. Data step thatcreates a column name of day of week mon tue wed thur...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i Have a table that will depend on whatever the column generates a filter for that &lt;/P&gt;&lt;P&gt; here is my syntax for the criteria for table&lt;/P&gt;&lt;P&gt;From Step1&lt;/P&gt;&lt;P&gt;where week contain Some=? .; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need help in how to make refer to output from week an make it a criteria ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TThanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 22:49:26 GMT</pubDate>
    <dc:creator>BETO</dc:creator>
    <dc:date>2015-07-15T22:49:26Z</dc:date>
    <item>
      <title>How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204237#M50917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi I have a. Data step thatcreates a column name of day of week mon tue wed thur...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i Have a table that will depend on whatever the column generates a filter for that &lt;/P&gt;&lt;P&gt; here is my syntax for the criteria for table&lt;/P&gt;&lt;P&gt;From Step1&lt;/P&gt;&lt;P&gt;where week contain Some=? .; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need help in how to make refer to output from week an make it a criteria ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TThanks &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 22:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204237#M50917</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-07-15T22:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204238#M50918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is the variable (column) named WEEK?&amp;nbsp; And what does the column actually contain?&amp;nbsp; Is it the text 'mon' or 'tue' like in your question?&amp;nbsp; Is the case consistent?&lt;/P&gt;&lt;P&gt;Then your selection criteria would look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where upcase(week) in ('MON','TUE')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where upcase(week) in ('WED','FRI')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do you in fact have multiple variables (columns) with names like MON, TUE, WED ?&amp;nbsp; If so then what do they contain?&amp;nbsp; Are they numbers or character strings.&lt;/P&gt;&lt;P&gt;Let's assume they are numbers with zero or missing meaning false and another value meaning true then your selection criteria looks like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where MON or TUE ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where WED or FRI ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 00:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204238#M50918</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-16T00:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204239#M50919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Tom&lt;/P&gt;&lt;P&gt;yes the data step will create the column "week"&amp;nbsp; and depending on yesterday day it will populate Mon or Tue or Wed or Thu or Fri .... then my table will into my criteria a filter for that &lt;/P&gt;&lt;P&gt;from Step1&lt;/P&gt;&lt;P&gt;where schedule contain = ? &lt;/P&gt;&lt;P&gt;I Don't know how to refer to my output from the data step week example for today it would pull Tue &lt;/P&gt;&lt;P&gt;so I need contain to eq Tue and tomorrow it should refer Wed&amp;nbsp; .....I need to be like a macro. Where there is no manual intervention... Thanks for help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 00:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204239#M50919</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-07-16T00:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204240#M50920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you need a WHERE clause if it is just going to load the data then report it?&lt;/P&gt;&lt;P&gt;Are you asking how to generate the string Wed if today is a Wednesday?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;where WEEK = "%sysfunc(today(),downame3)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Or if YESTERDAY was a Wednesday?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;where WEEK = "%sysfunc(putn(%sysfunc(today())-1,downame3))"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 01:25:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204240#M50920</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-07-16T01:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204241#M50921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Tom&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a data step that creates the yesterday day of the week&amp;nbsp; example today I would get&amp;nbsp; Wed....the name of that column is week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i I have another table that is looking into a schedule that looks like this &lt;/P&gt;&lt;P&gt;SChedule&lt;/P&gt;&lt;P&gt;Mon Wed Thu&lt;/P&gt;&lt;P&gt;Tue Wed Fri Sat&lt;/P&gt;&lt;P&gt;WEd Fri&lt;/P&gt;&lt;P&gt;WEd thu Sat&lt;/P&gt;&lt;P&gt;tue thu fri&lt;/P&gt;&lt;P&gt;mon Tue. Sat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what I need is on the second table I need to refer what the output was from the date step. For example if the output was Wed &lt;/P&gt;&lt;P&gt;then on the 2nd table I want to pull only were there is refer toWed ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i able I will need &lt;/P&gt;&lt;P&gt;ffrom. Table1&lt;/P&gt;&lt;P&gt;where schedule =week (wed) this could Mon ,Tue,Wed Thu,Fri..... So I will do a search for contain for that date of week.... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 16:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204241#M50921</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-07-16T16:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a variable from data step as criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204242#M50922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TThanks Tom I fig it out &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 17:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-a-variable-from-data-step-as-criteria/m-p/204242#M50922</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-07-17T17:52:38Z</dc:date>
    </item>
  </channel>
</rss>

