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

 

I am trying to send email via Data Integration Studio if I have a specific condition, as follows:

 

My condition is that if my situation variable, which comes from &_INPUT is =  'true', I send the email, if not, the program ends.

 

However, the following code sends the email even if the sitution is = 'false' or any other string. What am I missing?

 

 

data _null_;
set &_INPUT;
if situation ='true'
then call symput('message','this is my message');
run;

filename mymail email ("mymail@xxx.com")
	subject='This is my subject';

data _null_;
file mymail;
put "&message";
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Amir
PROC Star

Hi @tazz_bh,

 

If &_INPUT has multiple observations then the condition if situation = 'true' would be executed in sequence for every record in &_INPUT, so if any observation in the input data set allows this condition to be true then call symput() will be executed and message will have been set up as a macro variable with the value of "this is my message", and this would not be overwritten.

 

If &_INPUT only has one observation, then you might have to disconnect your SAS session as the macro variable message will hold its value between runs.

 

You can try testing with a new session with a value of 'false' first and see if that sends the message.

 

If this does not address your issue then please share some of the contents of &_INPUT and state how many rows it has.

 

 

Kind regards,

Amir.

View solution in original post

1 REPLY 1
Amir
PROC Star

Hi @tazz_bh,

 

If &_INPUT has multiple observations then the condition if situation = 'true' would be executed in sequence for every record in &_INPUT, so if any observation in the input data set allows this condition to be true then call symput() will be executed and message will have been set up as a macro variable with the value of "this is my message", and this would not be overwritten.

 

If &_INPUT only has one observation, then you might have to disconnect your SAS session as the macro variable message will hold its value between runs.

 

You can try testing with a new session with a value of 'false' first and see if that sends the message.

 

If this does not address your issue then please share some of the contents of &_INPUT and state how many rows it has.

 

 

Kind regards,

Amir.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 832 views
  • 0 likes
  • 2 in conversation