BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BETO
Fluorite | Level 6

Data Test_3;

Set Test_3;

if find(Deposit_Pull_Schedule,substr(left(put(today(),weekdate.)),1,3))-1 then

deliveryday="NO ";else deliveryday="YES";

Run;

I'm trying to create and IF statement currently in the cell I could have

1)MON

2)MON WED THU

3)MON TUE WED THU FRI

I need the if statement to look at cell name Deposit_Pull_Schedule to see if there is a match. Since report is running from yesterday pull I would like it to look for all of THU only.

Currently it gives me all no

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

maybe

Data Test_3;
   input Deposit_Pull_Schedule $50.;
  
if find(Deposit_Pull_Schedule,put(today()-1,weekdate3.),'I')
     
then deliveryday="YES";
     
else deliveryday="NO ";
  
cards;
1)MON
2)MON WED THU
3)MON TUE WED THU FRI
;;;;
   run;

View solution in original post

4 REPLIES 4
Reeza
Super User

Is the -1 in the wrong place, it should be today() -1 if you're looking from yesterday.....

But that's a wild guess because I don't fully understand what you're asking.

BETO
Fluorite | Level 6

Col1                        COL2

MON                          NO

MON TUE                   NO

MON THU                  YES

I will try it thanks for quick response. Above is an example of what I'm looking for since yesterday is what I'm comparing for . I'm looking for all THU

data_null__
Jade | Level 19

maybe

Data Test_3;
   input Deposit_Pull_Schedule $50.;
  
if find(Deposit_Pull_Schedule,put(today()-1,weekdate3.),'I')
     
then deliveryday="YES";
     
else deliveryday="NO ";
  
cards;
1)MON
2)MON WED THU
3)MON TUE WED THU FRI
;;;;
   run;
BETO
Fluorite | Level 6

ThanksI tweaked it to work for me

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
  • 4 replies
  • 754 views
  • 3 likes
  • 3 in conversation