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

HI All,

i was not comfortable not having any value after "NE", am i understanding it correctly as per my log message in Below program??

i read some documentation , https://v8doc.sas.com/sashtml/macro/z0543542.htm

and also referred Carpenters's Guide to Macro, Still not clear .

I am not clear what "NE" is comparing against!!

 

%macro jack(vals);

%if  &vals.  ne %then %do;

%put "Note:Has some values, therefore logical expression resolves to 1, which is True";

%end;

%else %do;

%put "Note:Does not have any value, therefore logical expression 0, which is false";

%end;

%mend;

%jack(nothing);

%jack();

 

So, is it going to be true anything except Missing values for &vals.!!

 

Thank You,

HimalayanCat

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16
Here NE blank space in the if condition indicates that if the macro parameter i.e., &vals is not blank then execute the condition to print in log the message 'Note:Has some values, therefore logical expression resolves to 1, which is True' else output to the log a message saying that 'Note does not have any value, therefore logical expression 0, which is false'
Thanks,
Jag

View solution in original post

3 REPLIES 3
jvdl
Obsidian | Level 7
Jagadishkatam
Amethyst | Level 16
Here NE blank space in the if condition indicates that if the macro parameter i.e., &vals is not blank then execute the condition to print in log the message 'Note:Has some values, therefore logical expression resolves to 1, which is True' else output to the log a message saying that 'Note does not have any value, therefore logical expression 0, which is false'
Thanks,
Jag

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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