07-15-2015 06:49 PM
hi I have a. Data step thatcreates a column name of day of week mon tue wed thur...
i Have a table that will depend on whatever the column generates a filter for that
here is my syntax for the criteria for table
where week contain Some=? .;
need help in how to make refer to output from week an make it a criteria ...
07-15-2015 08:24 PM
So is the variable (column) named WEEK? And what does the column actually contain? Is it the text 'mon' or 'tue' like in your question? Is the case consistent?
Then your selection criteria would look like
where upcase(week) in ('MON','TUE')
where upcase(week) in ('WED','FRI')
Or do you in fact have multiple variables (columns) with names like MON, TUE, WED ? If so then what do they contain? Are they numbers or character strings.
Let's assume they are numbers with zero or missing meaning false and another value meaning true then your selection criteria looks like:
where MON or TUE ;
where WED or FRI ;
07-15-2015 08:39 PM
yes the data step will create the column "week" 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
where schedule contain = ?
I Don't know how to refer to my output from the data step week example for today it would pull Tue
so I need contain to eq Tue and tomorrow it should refer Wed .....I need to be like a macro. Where there is no manual intervention... Thanks for help
07-15-2015 09:25 PM
Why do you need a WHERE clause if it is just going to load the data then report it?
Are you asking how to generate the string Wed if today is a Wednesday?
where WEEK = "%sysfunc(today(),downame3)"
Or if YESTERDAY was a Wednesday?
where WEEK = "%sysfunc(putn(%sysfunc(today())-1,downame3))"
07-16-2015 12:14 PM
i have a data step that creates the yesterday day of the week example today I would get Wed....the name of that column is week
i I have another table that is looking into a schedule that looks like this
Mon Wed Thu
Tue Wed Fri Sat
WEd thu Sat
tue thu fri
mon Tue. Sat
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
then on the 2nd table I want to pull only were there is refer toWed ...
i able I will need
where schedule =week (wed) this could Mon ,Tue,Wed Thu,Fri..... So I will do a search for contain for that date of week....