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

Hey, This code runs, but I wish to make sure it is correct because the "or" does not appears in "blue".

 

data EDcomb2;
set EDComb1;
if DD1=1 or DD2=1 or DD3=1 or DD4=1 or DD5=1 or DD6=1 or DD7=1 then DD=1; else DD=0;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

if you are checking to see if at least one of the values is eq to 1 then, yes, the code works correctly.

 

Art, CEO, AnalystFinder.com

View solution in original post

3 REPLIES 3
Astounding
PROC Star

Tell us what it is supposed to do, and we can venture an opinion about whether it is correct or not.

art297
Opal | Level 21

if you are checking to see if at least one of the values is eq to 1 then, yes, the code works correctly.

 

Art, CEO, AnalystFinder.com

Patrick
Opal | Level 21

@desireatem

Syntax highlighting makes the or blue in my SAS EG editor.

 

Should also other SAS language elements like data not appear in blue then make sure that you don't have something like an unbalanced quotation mark higher up in your code.

 

Capture.JPG

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!

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
  • 1102 views
  • 1 like
  • 4 in conversation