Hi Everyone,
I need one help related to macro variables which have null or no values which is resolving to " ".
I want to remove or supress " " this in output in SAS Email.
put "&segment1_Desc.<br />"; /*have no values*/
put "&segment1_link.<br />"; /*have no values*/
but in output getting " " " ". any ideas how to supress this " ".
Regards,
Manohar
Sorry for delay in response and thank you everyone for your revert.
I was able to solve the prolem by using %if and %len method.
This resolved the problem.
%if %length(Video_segment1) > 0 %then %do;
%put &Video_segment1.;
%put &Video_Desc.;
end;
Please post the complete code, from the definition of the macro variables to the final RUN or ODS statement of the mail.
Post your code into a code box opened with the "little running man" button, right next to the one indicated here:
The indicated button is for logs and other textual data where a non-porportional font and preserving horizontal positions and special characters is important.
How to remove missing values from email.
for below example:
put "<br />";
put "&segment1_Desc.<br />"; /*no values and coming as " " in log and output */
put "&segment1_link.<br />"; /*no values and coming as " " in log and output */
put "&segment2_Desc.<br />"; /*no values and coming as " " in log and output */
put "&segment2_link.<br />"; /*no values and coming as " " in log and output */
put "&segment3_Desc.<br />"; /*no values and coming as " " in log and output */
put "&segment3_link.<br />"; /*no values and coming as " " in log and output */
put "&segment4_Desc.<br />";
put "&segment4_link.<br />";
put "&segment5_Desc.<br />";
put "&segment5_link.<br />";
put "&segment6_Desc.<br />"; /*no values and coming as " " in log and output */
put "&segment6_link.<br />"; /*no values and coming as " " in log and output */
put "<br />";
for this I am getting " " in sas log and in sas test outlook email
below is log:
SYMBOLGEN: Macro variable SEGMENT2_DESC resolves to
MPRINT(EMAILHV): put " ";
in output it coming as
" " " " " " Video desc
video link
" "
I am trying to supress this " " to coming in mail.
Regards,
Manohar
Please do not spam library articles with questions. Questions belong here.
I requested that you post your whole code. DO SO.
Sorry for delay in response and thank you everyone for your revert.
I was able to solve the prolem by using %if and %len method.
This resolved the problem.
%if %length(Video_segment1) > 0 %then %do;
%put &Video_segment1.;
%put &Video_Desc.;
end;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.