BookmarkSubscribeRSS Feed
BETO
Fluorite | Level 6

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

From Step1

where week contain Some=? .;

need help in how to make refer to output from week an make it a criteria ...

TThanks

5 REPLIES 5
Tom
Super User Tom
Super User

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')

or

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 ;

or

where WED or FRI ;

BETO
Fluorite | Level 6

HI Tom

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

from Step1

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

Tom
Super User Tom
Super User

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))"

BETO
Fluorite | Level 6

hi Tom

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

SChedule

Mon Wed Thu

Tue Wed Fri Sat

WEd Fri

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 ...

second table

i able I will need

ffrom. Table1

where schedule =week (wed) this could Mon ,Tue,Wed Thu,Fri..... So I will do a search for contain for that date of week....

BETO
Fluorite | Level 6

TThanks Tom I fig it out

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1064 views
  • 3 likes
  • 2 in conversation