DATA Step, Macro, Functions and more

Code check

Accepted Solution Solved
Reply
Super Contributor
Posts: 303
Accepted Solution

Code check

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;


Accepted Solutions
Solution
‎07-05-2017 09:05 PM
PROC Star
Posts: 7,487

Re: Code check

[ Edited ]
Posted in reply to desireatem

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


All Replies
Super User
Posts: 5,516

Re: Code check

Posted in reply to desireatem

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

Solution
‎07-05-2017 09:05 PM
PROC Star
Posts: 7,487

Re: Code check

[ Edited ]
Posted in reply to desireatem

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

Respected Advisor
Posts: 4,173

Re: Code check

Posted in reply to desireatem

@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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 157 views
  • 1 like
  • 4 in conversation