BookmarkSubscribeRSS Feed
GalacticAbacus
Obsidian | Level 7

Hello, 

 

I've got some code where I'm checking for mutliple conditions to be met, and assigning a variable value depending on the conditions. However something in my syntax is off. Could anyone give me a tip? 

 

Data First_Channel_Defined;
Set Adobe_MB;
IF First_Channel = "ESHOP" AND FIND(S_CMP_Channel,'Paid Search)' AND FIND(Tracking_Code,'-b-') THEN First_Chnl_Mod ='PS_BRANDED';
ELSE IF First_Channel = "ESHOP" AND FIND(S_CMP_Channel,'Paid Search)' AND FIND(Tracking_Code,'-nb-') THEN First_Chnl_Mod ='PS_NONBRANDED';
ELSE IF First_Channel = "ESHOP" AND S_CMP_Channel = "" AND Matchtype IN ('MS','MU') THEN First_Chnl_Mod = 'CATALOG';
ELSE IF First_Channel ="ESHOP" AND S_CMP_Channel = "" THEN First_Channel_Mod = 'NO_SOURCE';
ELSE IF First_Channel = "ESHOP" THEN First_Channel_Mod = S_CMP_Channel;
ELSE IF Matchtype IN ('MS','MU') THEN First_Channel_Mod = "CATALOG";
ELSE First_Channel_Mod = "NO_SOURCE";

RUN;

2 REPLIES 2
Reeza
Super User

1. What makes you think something is wrong?

2. In your code you have both First_Chnl_Mod (first 3 IF's) and First_Channel_Mod (last 3 IF's), is this correct?

 

 

PGStats
Opal | Level 21

Replace 'Paid Search)'  --> 'Paid Search')

PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2 replies
  • 1084 views
  • 0 likes
  • 3 in conversation