BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tianerhu
Pyrite | Level 9
data work.all;
  merge apple.emp_name (in = emp_n)
        apple.emp_dept (in = emp_d);
  by empid;
  file print;
  put NOT emp_d=;
  run;

I code like above, but it doesn't work , the result is the logical value of the temporary emp_d ,not the 'not emp_d' , how should I do ?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
data work.all;
  merge apple.emp_name (in = emp_n)
        apple.emp_dept (in = emp_d);
  by empid;
  file print;
not_emp_d=(not emp_d);
  put NOT_emp_d=;
  run;
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26
data work.all;
  merge apple.emp_name (in = emp_n)
        apple.emp_dept (in = emp_d);
  by empid;
  file print;
not_emp_d=(not emp_d);
  put NOT_emp_d=;
  run;
--
Paige Miller
tianerhu
Pyrite | Level 9

Thank you for your help.

tianerhu
Pyrite | Level 9

the "not emp_d " is a expression ,not a variable , here we need a variable , so have the expression ---not emp_d assigned to a variable , then the code works . Thanks again.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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